Newsgroups: comp.std.c Path: utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: __STDC__ and non-strictly conforming ANSI C compilers Message-ID: <1988Dec18.041825.791@utzoo.uucp> Organization: U of Toronto Zoology References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> <12643@bellcore.bellcore.com> <9187@smoke.BRL.MIL> <11005@ulysses.homer.nj.att.com> <12666@bellcore.bellcore.com> Date: Sun, 18 Dec 88 04:18:25 GMT In article <12666@bellcore.bellcore.com> sjs@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 > 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@zoo.toronto.edu