gcc flags for developers

Nicolas Goutte nicolasg at snafu.de
Sat Dec 10 16:24:44 GMT 2005

On Saturday 10 December 2005 17:06, Nicolas Goutte wrote:
> On Saturday 10 December 2005 01:05, Lubos Lunak wrote:
> > Dne pá 9. prosince 2005 13:08 David Faure napsal(a):
> > > On Friday 09 December 2005 12:10, Dirk Mueller wrote:
> > > > - Also, full is a VERY bad option, as it disables important WARNINGS.
> >
> >  Care to elaborate slightly more on this? After checking the gcc manpage,
> > the only thing I could find was -Wuninitialized, so I guess the manpage
> > is missing all those important WARNINGS. Not that -Wuninitialized would
> > be that bad, it can certainly find some problems, but the description is
> > also rather clear on the fact that it cannot catch many of them, so
> > Valgrind may be in order in many cases anyway, and this warning alone
> > doesn't look to me like the reason to enable optimizations by default.
> He probably means that without -O2 (or perhaps -O1), gcc does not try some
> simplifications and therefore cannot find death code, unreachable code,
> unused variables and similar stuff.
> (Sorry, I cannot find quickly where it is described in gcc's info file.)

I have look further. You seem right that only -Wuninitialized is dependent on 
-O (I remebered something else, perhaps from older gcc versions).

Otherwise, I still think that this option is important, as uninitialized code 
can be quite annoying and I am sure that not all developers use Valgrind, 
especially not if no problem is visible.

> (...)
> Have a nice day!

Have a nice day!

More information about the kde-core-devel mailing list