how widespread is this cpp bug?

John Woods john at frog.UUCP
Tue Dec 6 12:44:00 AEST 1988


In article <12967 at duke.cs.duke.edu>, khera at romeo.cs.duke.edu (Vick Khera) writes:
> >#define VERSION 2
> >main() {
> >	proc/**/VERSION( a,b,c );
> >}
> I have used this ``feature'' to simplify having to write a bunch of
> duplicate code with a macro... how else would this macro be constructed? 
> 
In ANSI C, you use the ## operator.  In some existing C's, you just simply
can't construct such a macro, and if you ever want to use one of those C's,
you're out of luck.

The last time I wanted to do such a thing, I used M4 to generate the macros.
It was much more flexible, anyway.

-- 
John Woods, Charles River Data Systems, Framingham MA, (617) 626-1101
...!decvax!frog!john, john at frog.UUCP, ...!mit-eddie!jfw, jfw at eddie.mit.edu

Go be a `traves wasswort.		- Doug Gwyn



More information about the Comp.lang.c mailing list