Standardized predefined CPP symbols, down with folklore

Henry Spencer henry at utzoo.UUCP
Sat Jul 14 03:16:06 AEST 1984


> Nope.  "#define unix unix" followed by a use of "unix" will put the
> preprocessor into a loop, scanning "unix" over and over, until the
> recursion depth is hit and it punts with a fatal error message.

Actually, back in the dawn of time, the magic symbol "unix" *was*
defined as itself.  This went out when the preprocessor was rewritten
and started rescanning macro expansions for more macros.

The ANSI C draft, incidentally, says that the macro name is temporarily
undefined within its own body, so that "#define unix unix" would work.
(Permitting recursive macros seems silly, since the only thing they can
do is provoke an error message (or a core dump!) from the preprocessor.)
The issue of being able to test the thing in #if is still important, though.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list