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

Bug#289002: gcc-3.3: assignment of 64-bit constant (0x100000000) to unsigned long always fails



Luke Kenneth Casson Leighton <lkcl@lkcl.net>, 289002@bugs.debian.org schrieb am 06.01.05 19:10:48:

> math ops  - >> and & - cannot be performed with constants > 32-bit!

I don't see that.

> #define TEST 0x100000000
> 
> unsigned long test = (TEST >> 32);
> 
> gives a compile error!

It doesn't for me; it prints

test.c:3: warning: integer constant is too large for "long" type

Which is an entirely correct warning, since gcc defaults to the C99
standard, which does not have the "long long" type required to
represent the constant 0x100000000. Use -std=c99 if you want
to avoid this warning.

Unless I missed something, I think we can close this bug...

Falk





Reply to: