This is with the 4.3-20070525 snapshot. Test program:
void Alpha(); void Beta() { int i; for (i = 1; i > 0; ++i) Alpha(); } This invocation produces no warnings: /home/mec/gcc-4.3-20070525/install/bin/gcc -O2 -S -Wstrict-overflow=2 -Wall z1.c This invocation produces warnings: /home/mec/gcc-4.3-20070525/install/bin/gcc -O2 -S -Wall -Wstrict-overflow=2 z1.c z1.c: In function 'Beta': z1.c:5: warning: assuming signed overflow does not occur when simplifying conditional to constant It looks like -Wall sets the strict overflow warning level to 1, quietly stomping on the earlier setting. -- Summary: -Wall stomps on -Wstrict-overflow Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mec at google dot com GCC build triplet: i686-pc-linux-gnu GCC host triplet: i686-pc-linux-gnu GCC target triplet: i686-pc-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32102