From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeff Garzik Subject: Re: [PATCH] tabled: use LL to indicate 64-bit constant Date: Tue, 12 Jan 2010 14:24:25 -0500 Message-ID: <4B4CCC69.8040904@garzik.org> References: <1263129012-29423-1-git-send-email-cmccabe@alumni.cmu.edu> <4B4C873A.6050801@garzik.org> <436f52801001121025w57fc95cfn88c36f9ab5f5ee89@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030607080703050902050904" Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type; bh=8VRYEPLMxRnxwivpe7Adqhg3cCSijO6lAWIs0hvX5FY=; b=uZL3J6mKQPmjXhLeDIuK5eIwBlN6uE0QmwSNIZyVJKMB1V0FiqMJkJ35a/Xg7o6B4F dPrONmiJGTpavYC759bwMJY1nZkxS0bHiYaGpPWD2mHGdoRW+rBRUe0BuDc1s/ObdKeE MvO5PsDd+p4fqKZoZIrxrWa7qezf3J7eOTPc0= In-Reply-To: <436f52801001121025w57fc95cfn88c36f9ab5f5ee89@mail.gmail.com> Sender: hail-devel-owner@vger.kernel.org List-ID: To: Colin McCabe Cc: Project Hail List , Pete Zaitcev This is a multi-part message in MIME format. --------------030607080703050902050904 Content-Type: text/plain; charset="windows-1252"; format="flowed" Content-Transfer-Encoding: quoted-printable 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 type > > 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 the > 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 #if __WORDSIZE =3D=3D 64 typedef unsigned long int uint64_t; #else __extension__ typedef unsigned long long int uint64_t; #endif which causes the comparison type (uint64_t objcount) to vary between=20 32-bit and 64-bit platforms, even if the number of bits used to store it=20 remains the same. Strange... Jeff --------------030607080703050902050904 Content-Type: text/plain; name="x.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="x.c" #include #include #include #include #if 1 #define X 0xff00000000000000 #else #define X x #endif int main (int argc, char *argv[]) { uint32_t x = 0; if (__builtin_types_compatible_p (typeof (X), int)) printf("type: int\n"); else if (__builtin_types_compatible_p (typeof (X), unsigned int)) printf("type: unsigned int\n"); else if (__builtin_types_compatible_p (typeof (X), long)) printf("type: long\n"); else if (__builtin_types_compatible_p (typeof (X), unsigned long)) printf("type: unsigned long\n"); else if (__builtin_types_compatible_p (typeof (X), long long)) printf("type: long long\n"); else if (__builtin_types_compatible_p (typeof (X), unsigned long long)) printf("type: unsigned long long\n"); else printf("type: unknown\n"); (void) x; return 0; } --------------030607080703050902050904--