home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / next / programm / 7163 < prev    next >
Encoding:
Text File  |  1992-11-11  |  1.7 KB  |  43 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!ames!agate!dog.ee.lbl.gov!news!nosc!pages!bwebster
  3. From: bwebster@pages.com (Bruce F. Webster)
  4. Subject: Re: What does -DDEBUG actually do?
  5. Message-ID: <1992Nov11.151314.1225@pages.com>
  6. Sender: bwebster@pages.com
  7. Reply-To: bwebster@pages.com
  8. Organization: Banzai Research Institute
  9. References: <10NOV199211495062@mpx2.lampf.lanl.gov>
  10. Date: Wed, 11 Nov 1992 15:13:14 GMT
  11. Lines: 30
  12.  
  13. In article <10NOV199211495062@mpx2.lampf.lanl.gov> silbar@mpx2.lampf.lanl.gov  
  14. (Dick Silbar) writes:
  15. > I suspect this is very naive, but I looked all through the on-line manuals  
  16. and 
  17. > found no answer to the subject question.  The symbol table seems to be made
  18. > by the -g option to cc.  So what does -DDEBUG buy me?
  19. > One answer MIGHT be (I am guessing) the ability to denote some lines in my 
  20. > C code (with 'DEBUG'?), such as my favorite printf statements, so that they 
  21. > are compiled when -DDEBUG is declared, but not when it is not.
  22.  
  23. Exactly.  Among other things, this allows you to insert conditional code into  
  24. your program, bracketed as follows:
  25.  
  26. #ifdef    DEBUG
  27. <debugging code here>
  28. #endif
  29.  
  30.  
  31. ..bruce..
  32.  
  33. -------------------------------------------------------------------------------
  34. Bruce F. Webster             | Am a flamer, goateed, pallid, overweight,
  35. Chief Technical Officer      | Willing to pull two shifts, then (hell) a third,
  36. Pages Software Inc           | To save a session from a deadlocked state;
  37. bwebster@pages.com           | At times, (to put it mildly) unrestrained--
  38. #import <pages/disclaimer.h> | Almost, at times, a nerd.      -- Jeff Duntemann
  39. -------------------------------------------------------------------------------
  40.  
  41.