From owner-freebsd-questions Wed Jan 31 19:37:54 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dsl-64-193-218-89.telocity.com (dsl-64-193-218-89.telocity.com [64.193.218.89]) by hub.freebsd.org (Postfix) with SMTP id F40AB37B65D for ; Wed, 31 Jan 2001 19:37:36 -0800 (PST) Received: (qmail 24835 invoked by uid 1000); 1 Feb 2001 03:35:15 -0000 Date: Wed, 31 Jan 2001 21:35:15 -0600 From: Lucas Bergman To: Mike Meyer Cc: freebsd-questions@freebsd.org Subject: Re: Printf question Message-ID: <20010131213515.A12876@billygoat.slb.to> Reply-To: lucas@slb.to References: <109394@toto.iv> <14968.51016.322465.80746@guru.mired.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <14968.51016.322465.80746@guru.mired.org>; from mwm@mired.org on Wed, Jan 31, 2001 at 08:17:44PM -0600 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > What you probably want is the `%llu' specifier instead of `%ld'. > > Note that `long long' is a _very_ recent addition to the C > > standard, so proceed with caution if you want your program to be > > portable. > > The man page doesn't mention ll as a modifier, but talks about q. I > get the results he wants with %qd, %qu, or %llu - but not %lld. > -Wall doesn't complain about either one (on -current, anyway). Hrmm? roostor % echo 2 ^ 35 | bc 34359738368 roostor % cat foo.c #include int main(void) { long long x = 1LL << 35; printf("%lld\n", x); return 0; } roostor % gcc -Wall foo.c roostor % ./a.out 34359738368 Lucas To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message