Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix,net.lang.c,net.unix-wizards Subject: Re: Standardized predefined CPP symbols, down with folklore Message-ID: <4070@utzoo.UUCP> Date: Fri, 13-Jul-84 13:16:06 EDT Article-I.D.: utzoo.4070 Posted: Fri Jul 13 13:16:06 1984 Date-Received: Fri, 13-Jul-84 13:16:06 EDT References: <2065@rlgvax.UUCP> Organization: U of Toronto Zoology Lines: 16 > 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