Neil Schellenberger(deleted)
|
Re: Native gcc/qcc preprocessor debug directive?
|
Neil Schellenberger(deleted)
09/05/2008 12:14 PM
post12948
|
Re: Native gcc/qcc preprocessor debug directive?
A handy way to dump all pre-defined pre-processor macros using a
reasonably modern gcc is:
gcc -E -Wp,-dM -xc /dev/null | sort -u
(I don't think 2.95.3 supports -dM, but my memory is dreadful so I may
well be wrong.)
Add whatever other compile flags you normally use to see what, if any,
effect they have on the pre-defined pre-processor macros. The qcc front
end defines a few macros of its own; you can just substitute qcc for gcc
above.
Ryan is correct that gcc doesn't provide a pre-processor macro for -g.
It does, however, provide one for -O (#define __OPTIMIZE__) which you
might be able to use depending on you situation (e.g. if you always do
your debug builds with -O0).
Regards,
Neil
On Fri, 2008-09-05 at 10:41 -0400, Ryan Mansfield wrote:
> Andy Gryc wrote:
> > There is, but the sense is inverted. NDEBUG is defined if you're building release, and not defined when building
debug code.
>
> NDEBUG gets added by the recursive makefiles as a command line option to
> the compiler driver. gcc does not provide any built-in defines when
> compiling with or without debugging. The reason gcc does not provide
> any builtin defines is that it should generate the same code when
> debugging is enabled.
>
> Regards,
>
> Ryan Mansfield
>
> _______________________________________________
> General
> http://community.qnx.com/sf/go/post12930
>
|
|
|