Mail Archives: djgpp/1999/01/26/18:48:18
> Doesn't ANSI require NDEBUG to be defined for non-debug builds?
No.
NDEBUG is something that *you* define (or not) to control the
side-effects of the macros in <assert.h>. There is no correlation
between that and any other option.
You are confusing symbolic debugging with debug code. Symbolic
debugging is stuff like line numbers, parameter types, and whatnot
that are included in the output executable so that a debugger (like
gdb) can better represent the state of your program at any given time.
Debug code is code that you include in your program while you are
debugging it (like additional printfs or tests for conditions that
shouldn't happen), which you instruct the compiler to not include in
the final build.
The -g option controls symbolic debugging information.
The NDEBUG macro controls debug code defined by the assert() macro.
- Raw text -