home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!zaphod.mps.ohio-state.edu!cs.utexas.edu!natinst.com!news.dell.com!math.utexas.edu!ut-emx!jamshid
- From: jamshid@ut-emx.uucp (Jamshid Afshar)
- Newsgroups: comp.lang.c++
- Subject: Re: Debugging output
- Summary: call me crazy, but relying on compiler bugs is not a good idea
- Message-ID: <83463@ut-emx.uucp>
- Date: 12 Nov 92 18:40:30 GMT
- References: <Bx9369.3zL@cs.uiuc.edu> <1992Nov6.135017.6870@news2.cis.umn.edu> <BxAz2L.n4M@cs.uiuc.edu>
- Reply-To: jamshid@emx.utexas.edu
- Distribution: usa
- Organization: The University of Texas at Austin; Austin, Texas
- Lines: 23
-
- In article <BxAz2L.n4M@cs.uiuc.edu> pjl@cs.uiuc.edu (Paul Lucas) writes:
- ]In <1992Nov6.135017.6870@news2.cis.umn.edu> hansen@deci.cs.umn.edu (David M. Hansen) writes:
- ]>> #ifdef DEBUG
- ]>> # define CDEBUG if ( debug ) cerr
- ]>> #else
- ]>> # define CDEBUG //
- ]>> #endif
- ]>> CDEBUG << "here\n";
-
- ]>It is a bug because it means you have to be _very_ careful about how you
- ]>comment your code. For example, [...]
-
- ]*****> I already pointed out that this only works on C++-ignorant
- ] preprocessors; the above example is a well-known pitfall and I
- ] consider it irrelevant. You always have to do everything
- ] carefully.
-
- The only thing irrelevant here are your continued assurances that it
- works on some broken C++ implementations. So what? Your code is
- wrong. Why even present, much less defend, your solution?
-
- Jamshid Afshar
- jamshid@emx.utexas.edu
-