Standard scheme for maintainer-only debugging code?

Nathanael Nerode neroden@twcny.rr.com
Tue Jun 10 19:47:00 GMT 2003


>I'd be very careful with this.  Whetever we decide, we surely must not
>do anything that might dissuade developers from leaving in place code
>that will aid a future maintainer.  Even if such code is bit-rotted
>and needs fixing it can still be enormously helpful.  However,
>develeopers don't want to bloat the compiler with all their debugging
>stuff.
>
>#ifdef DEBUG_BARF code has saved my tail more than once.

Exactly.  But it's no good if a later developer can't find it.

That's why I want a *standard* scheme for DEBUG_BLAH conditionals; so
that it's clear what the point of the section was.

Things are #if 0'ed out for other reasons, such as temporary breakage; 
they're #if FOO'ed out for accidental reasons, such as when FOO used to 
be used and is no longer; etc.

Making it clear which disabled code is in fact for maintainers' 
debugging use is a Good Thing.

--Nathanael





More information about the Gcc mailing list