__STDC__ and non-strictly conforming ANSI C compilers

Henry Spencer henry at utzoo.uucp
Sun Dec 18 14:18:25 AEST 1988


In article <12666 at bellcore.bellcore.com> sjs at ctt.bellcore.com (Stan Switzer) writes:
>The important question is whether a __STDC__ compiler can be counted
>upon to compile strictly conforming programs.  The following fragment
>illustrates my point:
>
>	# include <stdlib.h>
>	int near( int i, int j ) {
>		return ( abs(i-j) < 10 );
>	}
>
>If "near" is a reserved keyword this will not compile even though it
>is strictly conforming...

Actually, it might, depending on your definition of "reserved keyword".
A truly devious compiler might turn off its predefined meaning for "near"
if "near" was encountered in a context indicating that the user was using
it himself.  (It is admitted that the ice might be thin here. :-))  This
would provide magic keywords *without* breaking standard conformance.
-- 
"God willing, we will return." |     Henry Spencer at U of Toronto Zoology
-Eugene Cernan, the Moon, 1972 | uunet!attcan!utzoo!henry henry at zoo.toronto.edu



More information about the Comp.std.c mailing list