Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!nrl-cmf!ukma!rutgers!att!pegasus!hansen From: hansen@pegasus.ATT.COM (Tony L. Hansen) Newsgroups: comp.std.c Subject: __STDC__ and non-strictly conforming ANSI C compilers Summary: what should they do? Keywords: ANSI C, __STDC__ Message-ID: <3236@pegasus.ATT.COM> Date: 13 Dec 88 21:42:01 GMT Reply-To: hansen@pegasus.att.com Organization: AT&T-Bell Labs, Lincroft, NJ Lines: 26 What do people think a compiler should do with __STDC__ if it is not strictly conforming? That is, if the compiler conforms to the spec, but has some of the "common" extensions? Examples are compilers which extend the 31-character name limit to flexnames, permit additional keywords such as "far" and "near", or have additional functions available such as "read()" and "write()". I've seen three solutions so far in as many compilers which plan on being ANSI C compatible. Each compiler offers different flavors (strictly conforming versus conforming with extensions) dependent on switches chosen when compiling. The default is non-strictly conforming for all compilers I've seen so far. 1) Only the strictly conforming flavor will have __STDC__ defined, and then to "1". 2) In non-strictly conforming mode, __STDC__ will be defined but will have a value of "0". 3) In all modes, __STDC__ will be defined with the value of "1". Which choice should be the correct one? Should the Rationale say something about it? Is there a 4th choice not listed above? Tony Hansen att!pegasus!hansen, attmail!tony hansen@pegasus.att.com