Article View: comp.sources.d
Article #759Re: #define DEBUG... (using printf for debugging)
From: Marc Ries
Date: Thu, 03 May 1990 20:13
Date: Thu, 03 May 1990 20:13
29 lines
1327 bytes
1327 bytes
In article <4250@tekfdi.FDI.TEK.COM> wallyk@tekfdi.FDI.TEK.COM (Wally Kramer) writes:
>
>In article <40628@cornell.UUCP> gordon@cs.cornell.edu (Jeffrey Adam Gordon)
>writes:
>
>>I want to have a DEBUG flag which controls whether diagnostic printfs
>>are executed or not.
>
>How about writing your diagnostic statements "thusly":
[...]
What ever happened to adding an argv Boolean variable "debug", switched
on the command line, and just do this in the code?:
if (debug) {printf("whatever", what_args);}
If you don't want to do it via the command line, then:
#ifdef DEBUG
debug = True/On/Etc.
#else
debug = False/Off/Etc.
#endif
--
Marc Ries
ries@venice.sedd.trw.com (ARPA)
somewhere!trwind!venice!ries (UUCP)
#include <std.disclaimer>
Technical Details
Message-ID:
<565@venice.SEDD.TRW.COM>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!trwind!venice!riesReferences:
<11290@hoptoad.uucp> <40628@cornell.UUCP> <4250@tekfdi.FDI.TEK.COM>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!trwind!venice!ries From: ries@venice.SEDD.TRW.COM (Marc Ries) Newsgroups: comp.sources.d Subject: Re: #define DEBUG... (using printf for debugging) Message-ID: <565@venice.SEDD.TRW.COM> Date: 3 May 90 20:13:56 GMT References: <11290@hoptoad.uucp> <40628@cornell.UUCP> <4250@tekfdi.FDI.TEK.COM> Reply-To: ries@venice.sedd.trw.com (Marc Ries) Organization: TRW Systems Engineering & Development Division, Redondo Beach, CA Lines: 29