This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Kill traditional mode


"Joseph S. Myers" <jsm28@cam.ac.uk> writes:

|> On Wed, 27 Feb 2002, Zack Weinberg wrote:
|> 
|> >  This is because 2147483648 cannot fit in the type @code{int}, so
|> > -(following the ISO C rules) its data type is @code{unsigned long int}.
|> > -Negating this value yields 2147483648 again.
|> > -
|> > -@item
|> > -GCC does not substitute macro arguments when they appear inside of
|> > -string constants.  For example, the following macro in GCC
|> > -
|> > -@example
|> > -#define foo(a) "a"
|> > -@end example
|> > +(following the ISO C rules) its data type is @code{unsigned int}.
|> > +Negating an unsigned 2147483648 yields 2147483648 again.
|> 
|> That's an incorrect change; decimal constants in C90 go int, long,
|> unsigned long.

And for C99 it's int, long, long long, and 2147483648 is guaranteed to
fit in long long.  On 64-bit platforms it already fits in long.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE GmbH, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]