This is the mail archive of the gcc-bugs@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]

[Bug c/31166] Integer hex constant does not follow promoting rules



------- Comment #1 from schwab at suse dot de  2007-03-13 20:22 -------
0x80000000 is of type unsigned int, negating it gives an unsigned int of the
same value, converted to long long still gives the same positive value.  On the
other hand 2147483648 is of type long long (in C99) because it does not fit in
long, and gives -2147483648 as long long when negated.  C90 does not have long
long, so 2147483648 is undefined behaviour, and GCC chooses unsigned long since
it fits there.


-- 

schwab at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31166


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