[Bug libstdc++/23271] Members of ctype_base appear not to be integral constant expressions.
davek at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Feb 15 17:33:00 GMT 2010
------- Comment #9 from davek at gcc dot gnu dot org 2010-02-15 17:32 -------
(In reply to comment #5)
> Is the print member really already overflowed? It has a value of 0200 which is
> 0x80: so if char is signed (it is on cygwin) then it's setting the sign bit,
> which should be OK I think.
No, it isn't. A signed char can contain values between 0x7f and -0x80.
Assigning a value of +0x80 to it results in overflow. You could assign
(char)0x80 to it and it would be ok, but 0x80 by itself isn't a constant that
will fit in a signed char, so it does need the cast (or to be expressed as the
negative equivalent.)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23271
More information about the Gcc-bugs
mailing list