The program below should emit a warning when compiled with -Wall or -Wsequence-point as a is read and modified. Also, would it be possible to get -Wsequence-point enabled by default in gcc? int foo (int count) { unsigned a = count; if ((a -= sizeof(count)) > a) return -1; return 0; }
Moved upstream: http://gcc.gnu.org/PR17880