------- Comment #3 from edwintorok at gmail dot com 2009-04-12 09:32 ------- (In reply to comment #2) > (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.
But converting from short to int for the argument to printf should behave as if a short value was converted to int, i.e. the int value should be in range -32768 to 32767, right? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39736