[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] tabled: use LL to indicate 64-bit constant

It's an old 32-bit machine.

I also notice that -std=gnu99 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.


On Tue, Jan 12, 2010 at 11:24 AM, Jeff Garzik <jeff@xxxxxxxxxx> wrote:
> On 01/12/2010 01:25 PM, Colin McCabe wrote:
>> util.c: In function ‘objid_init’:
>> util.c:331: warning: integer constant is too large for ‘long’ 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 == 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 32-bit
> and 64-bit platforms, even if the number of bits used to store it remains
> the same.
> Strange...
>        Jeff
To unsubscribe from this list: send the line "unsubscribe hail-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]

Add to Google Powered by Linux