🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #1540

Re: What does -DDEBUG actually do?

#1540
From: Bruce F. Webster
Date: Wed, 11 Nov 1992 15:13
29 lines
1770 bytes
In article <10NOV199211495062@mpx2.lampf.lanl.gov> silbar@mpx2.lampf.lanl.gov  
(Dick Silbar) writes:
> I suspect this is very naive, but I looked all through the on-line manuals  
and 
> found no answer to the subject question.  The symbol table seems to be made
> by the -g option to cc.  So what does -DDEBUG buy me?
> 
> One answer MIGHT be (I am guessing) the ability to denote some lines in my 
> C code (with 'DEBUG'?), such as my favorite printf statements, so that they 
> are compiled when -DDEBUG is declared, but not when it is not.
> 

Exactly.  Among other things, this allows you to insert conditional code into  
your program, bracketed as follows:

#ifdef	DEBUG
<debugging code here>
#endif


..bruce..

-------------------------------------------------------------------------------
Bruce F. Webster             | Am a flamer, goateed, pallid, overweight,
Chief Technical Officer      | Willing to pull two shifts, then (hell) a third,
Pages Software Inc           | To save a session from a deadlocked state;
bwebster@pages.com           | At times, (to put it mildly) unrestrained--
#import <pages/disclaimer.h> | Almost, at times, a nerd.      -- Jeff Duntemann
-------------------------------------------------------------------------------
Technical Details
Message-ID: <1992Nov11.151314.1225@pages.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!dog.ee.lbl.gov!news!nosc!pages!bwebster
References: <10NOV199211495062@mpx2.lampf.lanl.gov>

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!dog.ee.lbl.gov!news!nosc!pages!bwebster
From: bwebster@pages.com (Bruce F. Webster)
Subject: Re: What does -DDEBUG actually do?
Message-ID: <1992Nov11.151314.1225@pages.com>
Sender: bwebster@pages.com
Reply-To: bwebster@pages.com
Organization: Banzai Research Institute
References: <10NOV199211495062@mpx2.lampf.lanl.gov>
Date: Wed, 11 Nov 1992 15:13:14 GMT
Lines: 30