Is this standards compliant?
From: Kenny McCormack (gazelle_at_yin.interaccess.com)
Date: 12/30/04
- Next message: Andrey Tarasevich: "Re: const function() !!??"
- Previous message: Andrey Tarasevich: "Re: Address syntax"
- Next in thread: Ben Pfaff: "Re: Is this standards compliant?"
- Reply: Ben Pfaff: "Re: Is this standards compliant?"
- Reply: Martin Ambuhl: "Re: Is this standards compliant?"
- Reply: Emmanuel Delahaye: "Re: Is this standards compliant?"
- Reply: Old Wolf: "Re: Is this standards compliant?"
- Reply: Chris Croughton: "Re: Is this standards compliant?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Dec 2004 18:44:22 GMT
Aka, "How to make this warning go away?"
I have some code that contains:
#define FOO 2123456789L
I.e., a number that is greater than the limit for a signed 32 bit int.
I cannot use the above in a statement w/o compiler (gcc 2.95) issuing
a warning that says: decimal constant so large it must be unsigned.
For example:
unsigned int baz = FOO;
Should be OK, right?
Notes:
1) This is on a machine where ints and longs are both 32 bits.
2) I get same results with "long" instead of "int" (in the above
declaration).
Also, I tried:
#define FOO 2000000000L+123456789L;
And I get a different error (error this time) saying integer overflow...
I assume somewhere in the standard it says that compiletime math has to
work up to some level, right?
- Next message: Andrey Tarasevich: "Re: const function() !!??"
- Previous message: Andrey Tarasevich: "Re: Address syntax"
- Next in thread: Ben Pfaff: "Re: Is this standards compliant?"
- Reply: Ben Pfaff: "Re: Is this standards compliant?"
- Reply: Martin Ambuhl: "Re: Is this standards compliant?"
- Reply: Emmanuel Delahaye: "Re: Is this standards compliant?"
- Reply: Old Wolf: "Re: Is this standards compliant?"
- Reply: Chris Croughton: "Re: Is this standards compliant?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|