Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site orca.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!houxz!vax135!cornell!uw-beaver!tektronix!orca!andrew From: andrew@orca.UUCP (Andrew Klossner) Newsgroups: net.unix,net.lang.c,net.unix-wizards Subject: Re: Standardized predefined CPP symbols, down with folklore Message-ID: <936@orca.UUCP> Date: Wed, 11-Jul-84 17:06:39 EDT Article-I.D.: orca.936 Posted: Wed Jul 11 17:06:39 1984 Date-Received: Fri, 13-Jul-84 03:30:36 EDT References: <2065@rlgvax.UUCP> <142@pyuxt.UUCP> <8241@watmath.UUCP> <297@watdcsu.UUCP> <4842@utcsrgv.UUCP> Organization: Tektronix, Wilsonville OR Lines: 24 [] "Actually, it wouldn't matter if the implementors had had the sense to have cpp implcitly "#define unix unix", instead of "#define unix 1". The first would still permit all "#ifdef unix" work, while the actual implementation caused me grief one day when I tried to create a function called unix()" 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. Here's what it does under 4.2BSD: % cat >unix.c #define unix unix unix() {} % cc unix.c unix.c: 1: unix redefined unix.c: 2: unix: macro recursion % -- Andrew Klossner (decvax!tektronix!orca!andrew) [UUCP] (orca!andrew.tektronix@rand-relay) [ARPA]