Standardized predefined CPP symbols, down with folklore

Dave Sherman dave at utcsrgv.UUCP
Mon Jul 16 00:22:43 AEST 1984


In article <936 at orca.UUCP> andrew at orca.UUCP (Andrew Klossner) writes:
~| []
~| 
~| 	"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.
~| 

Why should that be true? Since the preprocessor is putting it in
implicitly anyway, it could easily have the smarts to skip over "unix"
in any re-scans of lines. This can obviously be made different from
a user-suppled "#define unix unix".

Dave Sherman
Toronto
-- 
 {allegra,cornell,decvax,ihnp4,linus,utzoo}!utcsrgv!dave
or
 David_Sherman%Wayne-MTS%UMich-MTS.Mailnet at MIT-Multics.ARPA



More information about the Comp.lang.c mailing list