This is the mail archive of the gcc@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: Standard scheme for maintainer-only debugging code?





On Tue, 10 Jun 2003, Nathanael Nerode wrote:
> > How about simply a convention: debugging code should be guarded by
> > 
> > if (debug_XYZ)
> > 
> > and debug_XYZ should be defined, for all XYZ, in some way which makes
> > it a constant 0, optimizable out, unless it's altered by a maintainer.

On Tue, Jun 10, 2003 at 11:13:18PM +0100, Joseph S. Myers wrote:
> Why does this code need to be compiled out?

So that the compiler doesn't get even slower?  Some of these flags might
be tested in inner loops.

> I suggest including the code
> unconditionally, controlled by some command-line option, as with the
> existing debugging RTL dumps. 

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.


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