Newsgroups: comp.lang.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: defining a comment? Message-ID: <1988Sep23.175337.6602@utzoo.uucp> Organization: U of Toronto Zoology References: <5438@techunix.BITNET> <844@vsi.UUCP> <855@vsi.UUCP> <678@ksuvax1.cis.ksu.edu> Date: Fri, 23 Sep 88 17:53:37 GMT In article <678@ksuvax1.cis.ksu.edu> vopata@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@zoo.toronto.edu