how widespread is this cpp bug?

David Goodenough dg at lakart.UUCP
Sat Dec 3 07:53:00 AEST 1988


>From article <9026 at smoke.BRL.MIL>, by gwyn at smoke.BRL.MIL (Doug Gwyn ):
> In article <6625 at csli.STANFORD.EDU> wagner at arisia.xerox.com (Juergen Wagner) writes:
>>      proc/**/VERSION
>>People relying on this bug should change their habits. There are better ways
>>to concatenate tokens.
> 
> No, for Reiser-based preprocessors there aren't any better ways.
> ANSI-style token pasting is fairly new, and many C implementations
> in current use do not support it.

% cat snark.c:
#define	proc()	proc

#define	grunt(baz)	proc()baz

main()
 {
    grunt(snarf);
 }

%cc -E snark.c
# 1 "snark.c"

main()
 {
    		procsnarf;
 }

%
Works for me.

Now, how it's used is open to discussion: I have seen it used when grunt()
becomes a procedure like macro that actually is a template for generating
a lot of copies of a structure.

Just out of idle curiosity, what is a Reiser-base preprocessor?
-- 
	dg at lakart.UUCP - David Goodenough		+---+
							| +-+-+
	....... !harvard!xait!lakart!dg			+-+-+ |
AKA:	dg%lakart.uucp at harvard.harvard.edu	  	  +---+



More information about the Comp.lang.c mailing list