Standardization questions (cpp mostly)

Henry Spencer henry at utzoo.UUCP
Sun Oct 7 08:47:54 AEST 1984


> We should return to the old days when vax was really 'vax',
> unix was really 'unix', and small furry creatures were still single.
> Here is a weak attempt at how it might be worded:
> 	The effect of '#define foo foo' and also '-Dfoo' as an option
> 	will be to make 'foo' defined and to evaluate to itself.
> 	Subsequently, foo and defined(foo) will both evaluate to 1
> 	within a #if, foo will be considered defined within a #ifdef
> 	or #ifndef, and foo will have no special meaning elsewhere.
> 
> I am sure the Standards committee can figure something out,
> so long as I can continue to use a variable named 'os' without
> worrying about whether some compiler somewhere has already spoken for it.

The committee has already made a partial step towards this.  Section
9.2 of the 21 Aug 1984 draft:

	"If the macro name itself appears during the scanning, it
	is not replaced."

In other words, "#define unix unix" will no longer send preprocessors
into infinite recursive plunges, which is the reason why this convention
was originally dropped.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list