------- 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