Matthias Andre has reported to SUSE a difference in integer handling in scanf() handling. The attached testcase has different results for 32bit and 64bit mode, even though "int" is 32bit signed in both modes (x86_64 and ppc confirmed). $ gcc -O2 -o foo foo.c -m32 $ ./foo s="18446744073709551615", n=1, i=2147483647, errno=34/Numerical result out of range s="4294967295", n=1, i=2147483647, errno=34/Numerical result out of range s="2147483647", n=1, i=2147483647, errno=0/Success $ gcc -O2 -o foo foo.c -m64 $ ./foo s="18446744073709551615", n=1, i=-1, errno=34/Numerical result out of range s="4294967295", n=1, i=-1, errno=0/Success s="2147483647", n=1, i=2147483647, errno=0/Success $ Expected: same output.
Created attachment 2717 [details] foo.c testcase
7.19.6.2#10: ... if the result of the conversion cannot be represented in the object, the behavior is undefined.