home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!sun-barr!olivea!sgigate!odin!bananapc.csd.sgi.com!ciemo
- From: ciemo@bananapc.csd.sgi.com (Dave Ciemiewicz)
- Newsgroups: comp.sys.sgi
- Subject: Re: Bug in /usr/lib/cpp ?
- Message-ID: <1992Sep11.183618.25338@odin.corp.sgi.com>
- Date: 11 Sep 92 18:36:18 GMT
- References: <stefans.716210195@bauv106>
- Sender: news@odin.corp.sgi.com (Net News)
- Organization: Silicon Graphics, Customer Support Division
- Lines: 45
- Nntp-Posting-Host: bananapc.csd.sgi.com
-
- In article <stefans.716210195@bauv106>, stefans@bauv106.bauv.unibw-muenchen.de (Stefan Schwarz) writes:
- |> Hi,
- |>
- |> the following statements cause trouble with cpp on Irix 4.0.5.
- |>
- |> #define Concat(a,b) a/**/b
- |> filename: /usr/lib/Concat(lib,X11.a)
- |>
- |> cpp produces: filename: /usr/lib/ libX11.a
- |> ^extra space
- |> I can't avoid this extra space!
- |>
- |> acpp doesn't do this, but for several reasons i cannot switch to acpp.
- |>
- |> Is this a bug or a feature?
- |>
-
- Changing /**/ to a space is a feature of acpp, not cpp.
-
- The ANSI-C standard committee decided that /**/ should become a space as
- was specified in K&R C and not become a space as was the adopted practice
- of some versions of cpp. (See the ANSI-C standard "Rationale" section).
-
- ANSI-C defines a ## operator for concatenation.
-
- If you change your define to the following, all will work well under
- both Classic cpp and the ANSI-C cpp (acpp):
-
- #ifdef __ANSI_CPP__
- #define Concat(a,b) a ## b
- #else
- #define Concat(a,b) a/**/b
- #endif
-
- Don't forget, under IRIX 4.0.5, the default C compiler is the ANSI-C compiler
- and not the Classic C compiler. To get Classic C, you must use -cckr.
-
-
- --
-
- __ * __ _ __ ___
- / \ / / / / \/ \/ \ He was a man like any other man, however, not
- / / \/ / /\ / / quite like any other man.
- \___/\__/\_/ /_/ / \__/
- *
-