This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36402] -0x80000000 (INT_MIN) erroneously treated as unsigned
- From: "gcczilla at achurch dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jun 2008 04:17:10 -0000
- Subject: [Bug c/36402] -0x80000000 (INT_MIN) erroneously treated as unsigned
- References: <bug-36402-6266@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from gcczilla at achurch dot org 2008-06-01 04:17 -------
Fair enough, but GCC's documentation explicitly says (gcc.info section 4.5):
* `Whether signed integer types are represented using sign and
magnitude, two's complement, or one's complement, and whether the
extraordinary value is a trap representation or an ordinary value
(C99 6.2.6.2).'
GCC supports only two's complement integer types, and all bit
patterns are ordinary values.
Given that, I think a typical user would assume (as I have) that GCC would
treat -0x80000000 as the signed value -2^31; otherwise there would seem to be
no way to write a single constant to represent that valid value. So I'm going
to have to argue that this is still a bug, whether in the documentation or in
the compiler itself.
--
gcczilla at achurch dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36402