This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Does GCC have any built-in DEBUG preprocessor flags?


Joseph D. Wagner wrote:

> I'm wondering if GCC automatically defines any preprocessor DEBUG
> flags when executed with the -g option.

At first glance through specs and source, no.

> For example, when a program compiles on Microsoft Visual C++ in
> Debug mode, the compiler automatically defines _DEBUG as a
> preprocessor flag,

_DEBUG is auto-defined for /MDd, /MTd or /MLd - i.e. it's more "compiled
for debug runtime". /Zi and /ZI (more analagous to -g) don't trigger it.

In any case, MSVC-generated projects explicitly include -D_DEBUG on
debug compile lines.

Rup.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]