Subject: Re: Warnings in nfsv3 code--buggy gcc?
To: None <jmc@pobox.com>
From: Per Fogelstrom <pefo@enea.se>
List: tech-kern
Date: 03/31/1996 12:00:25
> >
> >Hmm.. tried your example on 2.7.2 (mips) without any complaints (-Wall).
> >But the above exapmple is maybe not represenative for the real code.
> >
> 
> Compile the code with -O and try again. Gcc doesn't do flow analysis until 
> some form of optimization gets turned on. This is also very annoying since in

I did compile it with -O -Wall and -O2 -Wall so thats not why. I'm not
that stupid, but thanks for pointing it out. :-)

> general I develope code with -g and then turn on optimization after I'm
> fairly certain of base functionality working. To suddenly have error free
> and warning free code start generating spurious warnings only with -O seems
> a bit ridiculous.
> 
Perhaps the uninitialized warning check should be give explicit?

Sad to say but to often compilers generates different "bugs" dpending on
level of optimization. For examples some compilers do different things
when "-g" is given or not. So don't assume a program that work compiled
with -g to work compiled without -g. Although it should of course.

Been there. Seen that. Did that. :-)