gcc flags for developers

Nicolas Goutte nicolasg at snafu.de
Sat Dec 10 16:06:11 GMT 2005


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.)

(...)

Have a nice day!





More information about the kde-core-devel mailing list