From: Colin McCabe Subject: Re: [PATCH] tabled: use LL to indicate 64-bit constant Date: Tue, 12 Jan 2010 11:57:38 -0800 Message-ID: <436f52801001121157v9be297p6cb16482b8ed42ed@mail.gmail.com> References: <1263129012-29423-1-git-send-email-cmccabe@alumni.cmu.edu> <4B4C873A.6050801@garzik.org> <436f52801001121025w57fc95cfn88c36f9ab5f5ee89@mail.gmail.com> <4B4CCC69.8040904@garzik.org> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=aCILc9CLiRfDYNPgTvL1iRNs/8MF2P+lcAjW8VdaJkA=; b=l0BsdDt7WjqrhWSn/mHI8FAQOVf7jMinRdcbq5i43ci2XlXlEMzBqkWLIKSEeQ1/mk aKxTKz0tdvW27Ls2+cSx4GgMeTSflFBoq/vBu8Um2I/0f0veT2/iKj36QEgkW4vzF9Ec gl8zS2PbffdvVN2U6sx3nHTM0gbGJcE1X+Oeo= In-Reply-To: <4B4CCC69.8040904@garzik.org> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="windows-1252" To: Jeff Garzik Cc: Project Hail List , Pete Zaitcev It's an old 32-bit machine. I also notice that -std=3Dgnu99 makes the warning go away. I don't think that "long long" existed in C89, except as a compiler-specific extension. I guess that explains the error: gcc tries to promote the integer constant to a long, finds that a long isn't big enough (because we're on 32 bit), and then issues a warning. And then it promotes to the gcc-specific long long type. Colin On Tue, Jan 12, 2010 at 11:24 AM, Jeff Garzik wrote: > On 01/12/2010 01:25 PM, Colin McCabe wrote: >> >> util.c: In function =91objid_init=92: >> util.c:331: warning: integer constant is too large for =91long=92 ty= pe >> >> with >> >> [cmccabe@stargazer tabled]$ gcc --version >> gcc (GCC) 4.4.1 20090725 (Red Hat 4.4.1-2) >> >> Now that I wrote a little test program, I can see that gcc handles t= he >> constant correctly. It still issues a warning for some reason. >> I guess gcc's C99 support is not perfect. > > Is this on a 32-bit on 64-bit compiler platform? > > Because Linux does > > =A0 =A0 =A0 =A0#if __WORDSIZE =3D=3D 64 > =A0 =A0 =A0 =A0typedef unsigned long int =A0 =A0 =A0 uint64_t; > =A0 =A0 =A0 =A0#else > =A0 =A0 =A0 =A0__extension__ > =A0 =A0 =A0 =A0typedef unsigned long long int =A0uint64_t; > =A0 =A0 =A0 =A0#endif > > which causes the comparison type (uint64_t objcount) to vary between = 32-bit > and 64-bit platforms, even if the number of bits used to store it rem= ains > the same. > > Strange... > > =A0 =A0 =A0 =A0Jeff > > >