------- Comment #2 from mikpe at it dot uu dot se 2009-04-12 09:11 ------- (In reply to comment #1) > There is no undefined behavior here (increment of a short value converts > to int, increments then converts back to short, none of which are > undefined), so at least the wrong code issue would be the same as bug > 35634.
It's not undefined, but the conversion from int back to short provokes implementation-defined behaviour when the int value doesn't fit in a short. That makes this test program not strictly conforming. The lack of a compile-time warning is unfortunate, but I don't think this is a case of wrong-code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39736