On Fri, Dec 06, 2002 at 11:16:30PM -0500, Bruce Momjian wrote:
>
> I use:
>
> -Wall -Wmissing-prototypes -Wmissing-declarations -Wpointer-arith -Wcast-align
Some other useful ones are -pedantic -W -Wfloat-equal -Wshadow
-Wcast-qual -Wwrite-strings -Wconversion -Wsign-compare -Wsign-promo.
> You would think that would catch it. My problem is that I am compiling
> with -O0, because I compile all day and I don't care about optimization.
> In this case, the -O3 is doing some optimization that catches the
> problem, while -O0 does not. Interesting. Even -O catches it.
Last time I checked (which was admittedly some time ago) all the
interesting analysis that could give you new warnings was done by -O;
-O2 mostly involves the back-end, and -O3 adds pretty much nothing
except aggressive inlining. Which was more likely to trigger compiler
bugs at the time than to find anything in your code.
Jeroen