This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: stdint.h


> I'd like to point out that the glibc version of stdint.h also uses the
> (-2147483647 - 1) variation.  There must be a good reason, 
> but I fail to find a reference right now, which could help to 
> explain this to all of us.  

Doesn't your version of gcc output:

warning: this decimal constant is unsigned only in ISO C90

Try -std=gnu99 and you might get a different result.

In C90 mode, GCC treats 2147483648 as an unsigned int. It then negates it,
before casting to a long long, and -2147483648 is the same as 2147483648 in
only 32-bits. 

Cheers,
Jon


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