#define DEBUG... (using printf for debugging)

James D Moore jmoore at cidmac.ecn.purdue.edu
Fri May 4 23:03:46 AEST 1990


In article <1717 at engage.enet.dec.com> wallace at oldtmr.enet.dec.com (Ray Wallace) writes:
>
>In article <4247 at tekfdi.FDI.TEK.COM>, wallyk at tekfdi.FDI.TEK.COM (Wally Kramer)
>writes...
>>In article <40628 at cornell.UUCP> gordon at cs.cornell.edu (Jeffrey Adam Gordon)
>>writes:
>>>I want to have a DEBUG flag which controls whether diagnostic printfs
>>>are executed or not.

Several people have pointed out several ways to use the #define to 
equate DEBUG to printf. I personaly feel that using the standard
#ifdef and using the the "-D<flag>" option at compile time is the
best way to do it. Am I missing something here ? I do this with
different levels of debugging so I can have several flags. Anyway
that is my $0.2 worth.

Jim Moore
Purdue University
jmoore at cidmac.ecn.purdue.edu



More information about the Comp.lang.c mailing list