On Wed, May 30, 2007 at 03:48:05PM -0700, Ian Lance Taylor wrote: > http://gcc.gnu.org/PR32102 is about the fact that -Wall > -Wstrict-overflow is not the same as -Wstrict-overflow -Wall (i.e., > the order of the options matter). The reason is that -Wall sets > warn_strict_overflow to 1 and -Wstrict-overflow sets > warn_strict_overflow to 2. > > It is normal and expected that if you specify the same option twice, > the later one takes precedence. But it is, perhaps, less expected > that a general option like -Wall changes the behaviour of a specific > option like -Wstrict-overflow. This of course also applies to the > optimization options: -fno-tree-vrp -O2 will cause the -fno-tree-vrp > option to be ignored. > > Does anybody have an opinion on whether the current behaviour is good > or bad? The documention suggests that the order of different options > does not matter, so if the current behaviour is good, we should fix > the documentation.
I think it's bad; users will not expect that the option order matters, and the typical way that warnings get set up in Makefiles (often as the concatenation of several options variables) would cause problems for users. How about: have -Wall still set warn_strict_overflow to 1, but to have -Wall -Wstrict-overflow *or* -Wstrict-overflow -Wall *or* just -Wstrict-overflow set it to 2? The only change would be to prevent -Wall from *decreasing* the value.