debugging - Can I successfully use DEBUG as a constant symbol in C? -
in class work, i've done successfully, in simple programs. today, had more complex program, , eclipse did horrible borky things after defined debug symbol, , these horrible things did not go away after removed definition. i've been told source symbol debug in used gcc compiler, , interfering standard library defining myself.
is okay use #define debug myself? or not?
yes, ok define symbol debug
yourself. not ok define symbol _debug
(note leading underscore): symbols beginning underscore , capital letter, or 2 underscores, reserved use implementation (that is, compiler , toolchain). since reserved, should not define them yourself, can test existence. see §7.1.3 of c99 standard.
another symbol aware of ndebug
, free define or not define, if define before inclusion of <assert.h>
, causes assert
statements removed.
Comments
Post a Comment