This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31166] Integer hex constant does not follow promoting rules
- From: "schwab at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Mar 2007 20:22:37 -0000
- Subject: [Bug c/31166] Integer hex constant does not follow promoting rules
- References: <bug-31166-14238@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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