Standard scheme for maintainer-only debugging code?
DJ Delorie
dj@redhat.com
Tue Jun 10 23:09:00 GMT 2003
> Of course, there's a way to achieve both: debug_XYZ could be defined to
> any of 0, 1, or flag_debug_XYZ, and there could be a single #ifdef to
> make all of the flags variable.
Perhaps enabled with --enable-maintainer-mode?
I.e. default to being compiled out, but with --enable-maintainer-mode
it becomes a runtime test?
We could end up with code like:
if (DEBUGFLAG(foo))
{
}
where DEBUGFLAG(foo) is either zero or expands to some runtime test
(array of flag bits, table of given options, #defines, whatever).
More information about the Gcc
mailing list