-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 11/04/11 07:58, Andrew MacLeod wrote: > On 11/04/2011 08:51 AM, Joseph S. Myers wrote: >> >> DR#109 applies: "A conforming implementation must not fail to >> translate a strictly conforming program simply because some >> possible execution of that program would result in undefined >> behavior.". The value of a function parameter (that has the >> right type) is a property of the execution of the program and >> undefined behavior occurs when the call is executed, after its >> arguments have been evaluated. >> >> Generating a warning instead of an error and changing the >> constant to a valid one is probably the simplest fix (although >> generating a trap as well, after the arguments are evaluated, >> would be existing practice in GCC). >> > Fair enough, Im sold. > > Here's the updated c-family file (with an updated changelog as > well). I added a warning to common.c and updated > builtins.c::get_memmodel where the same error was issued. That is > changed to a warning as well. I also added an entry in the > testsuite to check for the warning. This stuff is well out of my area of expertise. Hopefully others will continue to chime in. The only thing I saw was a formatting nit:
! /* Only convert parameters if the size is appropriate with new format ! sync routines. */ ! if (orig_format || ! tree_int_cst_equal (TYPE_SIZE (ptype), TYPE_SIZE (arg_type))) Boolean operator goes on the next line like this if (orig_format || tree_int_cst_equal ..) jeff -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOtC+9AAoJEBRtltQi2kC7KekH/3p+yIdzyHRFFN5S6juiuKdF 1zRH2r2D+j53o9YPU13JheWG8mqvKC59NrY8MvWK+rwOJeSDLymEKOw7kbUhm7uO JEAPq4oHyf8F4VCHQ57e0TeqHRch9CXyyssiQyV8enI/3Jpowz5v1XAC3IzpIfG2 0DpsYVG/J1mLZKZPIbHUCSDxMrGnIPyfxgOk4x+Tudr6rTuLiQWuAKytik51ZQj9 3RmKOVxSZcLhz/vQ+ocH2qcZsEHx8mhTItynBe2hO1TiGvC+goxjS9JWi9/+may1 4hL7DG4z0o8/qjT/icse9S2XNUdk7rsa8jrggwg4jKv2Xm/BePb6qYFuIYcs580= =7+rV -----END PGP SIGNATURE-----