__STDC__ and non-strictly conforming ANSI C compilers
Tony L. Hansen
hansen at pegasus.ATT.COM
Wed Dec 14 07:42:01 AEST 1988
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 at pegasus.att.com
More information about the Comp.std.c
mailing list