home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!think.com!sdd.hp.com!spool.mu.edu!umn.edu!hecto.cs.umn.edu!hansen
- From: hansen@hecto.cs.umn.edu (David M. Hansen)
- Subject: Re: Debugging output
- Message-ID: <1992Nov9.235112.2255@news2.cis.umn.edu>
- Sender: news@news2.cis.umn.edu (Usenet News Administration)
- Nntp-Posting-Host: hecto.cs.umn.edu
- Organization: University of Minnesota
- References: <spuler.720931050@coral> <Bx9369.3zL@cs.uiuc.edu> <1992Nov6.135017.6870@news2.cis.umn.edu> <BxAz2L.n4M@cs.uiuc.edu>
- Distribution: usa
- Date: Mon, 9 Nov 1992 23:51:12 GMT
- Lines: 45
-
- 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:
- |>
- |> >In article <Bx9369.3zL@cs.uiuc.edu>, pjl@cs.uiuc.edu (Paul Lucas) writes:
- |> >|> *****> This is overkill; the same thing can be achieved without
- |> >|> inventing another class:
- |> >|>
- |> >|> #ifdef DEBUG
- |> >|> # define CDEBUG if ( debug ) cerr
- |> >|> #else
- |> >|> # define CDEBUG //
- |> >|> #endif
- |> >|>
- |> >|> // ...
- |> >|>
- |> >|> CDEBUG << "here\n";
- |> >|>
- |> >|> This allows the flexibility of having debugging "togglable"
- |> >|> during development, presumeably by a command-line option, but
- |> >|> can be compiled-out in the final version.
- |> >|>
- |>
- |> >I think it is a mistake to rely on what is essentially a bug in many C++
- |> >compilers. According to the ARM (section 16.1, page 370) "...a single white
-
- [ARM reference and example deleted]
-
- |>
- |> *****> 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.
-
- True, the example is irrelevant.
-
- True, you _always_ have to do everything carefully.
-
- Perhaps you pointed out that it doesn't always work. I didn't see it (mea culpa).
- This is also irrelevant.
-
- It is _still_ a mistake to rely on a bug.
-
- -=Dave
-
-
-