[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



On Thu, Jan 06, 2005 at 07:31:59PM +0100, Falk Hueffner wrote:
> 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
 
 ah - yes.

> 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.

 ah!  okay!  thank you.

 ... but does it behave correctly / as expected?

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

 more than likely...  ta!

 l.




Reply to: