defining a comment?

Henry Spencer henry at utzoo.uucp
Sat Sep 24 03:53:37 AEST 1988


In article <678 at ksuvax1.cis.ksu.edu> vopata at ksuvax1.cis.ksu.edu (Ed Vopata) writes:
>Yes!  The following in a sample program which will demonstrate the use of
>STARTCOM and ENDCOM macros for defining the beginning and ending of a C
>Comment.  Also included is the output of the preprocessor (cc -E).  I have 
>compiled this program on a couple of C compilers (one provided with 4.3 BSD
>and one provided by AT&T) and the program works.

It would probably work with any compiler using the Reiser preprocessor,
which is used by most Unix compilers (and, in particular, by essentially
all PCC-derived compilers).  It won't necessarily work with brand-X
preprocessors.

I'll say it again, just in case it didn't penetrate the first time:  there
is *no* portable way to do this.  In particular, doing it in ANSI C is
fundamentally impossible, because comment stripping precedes preprocessing.
(One of X3J11's more laudable, and simultaneously more difficult, feats
was to actually make questions like this easy to answer!)
-- 
NASA is into artificial        |     Henry Spencer at U of Toronto Zoology
stupidity.  - Jerry Pournelle  | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.lang.c mailing list