defining a comment?

Henry Spencer henry at utzoo.uucp
Thu Sep 15 01:36:48 AEST 1988


In article <5438 at techunix.BITNET> benny%techunix.bitnet at jade.berkeley.edu (Benny Pinkas) writes:
>Can I use the Preprocessor to define a comment?

Well, maybe.  The draft standard unambiguously says "no":  comments are
scanned and deleted before preprocessing is done.  However, many existing
implementations do things differently.  The preprocessor semantics were
never very well specified.  Given that most implementations will comply
with, or at least move towards, ANSI compliance eventually, you should
not rely on it.

>#define COM /*this is a comment*/

This ends up defining COM to be white space, which is legitimate.

>#define STARTCOM /*

This isn't going to work.
-- 
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