[Bug target/43249] unsigned int arg with no prototype gets full 64-bit reg

amodra at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed May 26 13:23:00 GMT 2010



------- Comment #2 from amodra at gmail dot com  2010-05-26 13:22 -------
I think this testcase may invoke undefined behaviour.  Section 6.5.2.2 of the
ISO C spec says of function calls without a prototype that if "the types of the
arguments after promotion are not compatible with those of the parameters after
promotion, the behavior is undefined, except for the following cases" and the
relevant case is "one promoted type is a signed integer type, the other
promoted type is the corresponding unsigned integer type, and the value is
representable in both types".

The value you are passing, (int)4294967259U, is a negative number so not
representable as an unsigned int.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43249



More information about the Gcc-bugs mailing list