unterminated .h files, __CAT__, etc.

Michael Meissner meissner at dg_rtp.UUCP
Sat Aug 2 00:24:47 AEST 1986


In article <470 at mcgill-vision.UUCP> mouse at mcgill-vision.UUCP (der Mouse) writes:
>
>> __STR__ and __CAT__ were suggested by Tom Plum in a late-night
>> working session to resolve the remaining preprocessor issues,
>
>> The Reiser CPP is definitely out.
>
>I don't see what's wrong with Reiser cpp's answer to the str and cat
>problems (formal substitution in strings and /**/).  Could someone
>enlighten me?  The former (formals inside ""s) can bite, but only if
>you're not aware of it (using the same name for a formal and a global
>within the macro can bite too, so the possibility of being bitten will
>not go away with __STR__).  The only thing I can see wrong with /**/
>for __CAT__ is that cc -E -C, such as is used by lint, won't do
>contatenation, but the preprocessor could easily be made to strip /**/
>even under -C).

There are two main reaons why the reiser cpp's mechanisms (of stringizing and
token pasting) have a different syntax in the draft X3J11 standard.  First,
it is nearly impossible to formalize in a step by step manner (and the main
reason for standards is to formalize things), and also the reiser cpp violates
K&R (where it states that comments are ALWAYS turned into whitespace, and
where it explicitly states that text inside of strings and char constants.

The relavant K&R quotes are:

page 179:
	Blanks, tabs, newlines, and COMMENTS (collectively, "white space")
	as described below are ignored except as they serve to separate
	tokens.

page 207:
	Text inside a string or a character constant is NOT subject to
	replacement.

Michael Meissner, Data General, ...{decvax}!mcnc!rti-sel!dg_rtp!meissner



More information about the Comp.lang.c mailing list