defining a comment?

Stephen J. Friedl friedl at vsi.UUCP
Thu Sep 22 04:17:05 AEST 1988


In article <5438 at techunix.BITNET>, benny at techunix.BITNET (Benny Pinkas) writes:
>
> Can I use the Preprocessor to define a comment? I mean something like:
> 

Then, in article <844 at vsi.UUCP>, friedl at vsi.UUCP (*me*) writes:
> I'm surprised nobody posted this,
> 
> # define	STARTCOM	//**/*
> # define	ENDCOM		*/**//

I'll be durned, it doesn't work.  The first part does indeed
define STARTCOM to be /*, but I thought that once the STARTCOM
was replaced by /*, it would pass it onto the compiler unchanged
(the compiler accepts the same comment notation as cpp).
Apparently, however, it rescans this at cpp-time and the ENDCOM
is never macro-expanded.

I could have sworn I did this once, and I suspect that a maniac
with cpp could probably find a way to do this, but I couldn't.

Thanks to Don Seeley at U-of-Utah for throwing the egg on my face :-).

-- 
Steve Friedl    V-Systems, Inc.  +1 714 545 6442    3B2-kind-of-guy
friedl at vsi.com     {backbones}!vsi.com!friedl    attmail!vsi!friedl
------------Nancy Reagan on conductance: "Just say mho"------------



More information about the Comp.lang.c mailing list