gcc flags for developers

Dirk Mueller mueller at kde.org
Wed Dec 7 02:24:15 GMT 2005


On Friday 02 December 2005 14:07, David Faure wrote:

> > No, it gives you "-O2 -g" for historic reasons.
> Can we change the defaults so that reasonable/useful flags are being used
> then?

I don't see a reason why we can't, except that there might be somebody whining 
about it when he uses a complicated preprocessor macro (because without -g3 
you can't actually track where a preprocessor macro was expanded from, and 
even then only if you're lucky). 

> Problem is, I see two possibilities, for developers:
> 1) with debug but with -O0 so that gcc runs fast   (or does -O1 make gcc
> fast enough?) 2) with debug and with "-O2 -fno-reorder-blocks
> -fno-schedule-insns -fno-inline" so that the code runs faster and so that
> all warnings can be seen.



> Does this mean it would make sense to have
>  --enable-debug=fast for the first one,  and make --enable-debug select the
> second one?

Well, "fast" would mean that it compiles fast, not that you can debug fast :)

>  --enable-debug=fast for the first one and --enable-debug=optimized for the
> second one, to keep the current --enable-debug as -O2 -g? Although I don't
> see any point in leaving things unchanged 'for historical reasons' if
> everyone agrees that it's wrong that way.

Well, from what I see most people use kdesvnbuild these days ,which overwrites 
flags with horrifying hacks, so this is probably low priority. 

-- 
Dirk//\




More information about the kde-core-devel mailing list