__STDC__ and non-strictly conforming ANSI C compilers
Doug Gwyn
gwyn at smoke.BRL.MIL
Tue Dec 27 16:42:37 AEST 1988
In article <14179 at oberon.USC.EDU> english at stromboli.usc.edu (Joe English) writes:
>I'm still unclear on the meaning of __STDC__... does it mean
>"supports prototypes, void, signed, etc.," or "strictly conforming,
>no extensions?" Or is this not specified?
__STDC__ must be defined (and have the value 1) by any conforming
implementation. There are not "degrees" or "levels" of conformance;
either an implementation is standard conforming or it is not. (There
are, however, both "freestanding" and "hosted" environments, and an
implementation conforms to at most one of these at a time.)
The intention is for the very fact that __STDC__ is defined to
suffice to tip off the application source code that the C Standard
is conformed to, which enables it to use features not available in
older C compilers as well as to help accommodate changes mandated
by the Standard in a specific environment (unsigned-preserving to
value-preserving in UNIX environments, for example). Somewhere
along the way it was decided that just being "defined" was too
vague, so for this version of the Standard at least, __STDC__ has
the value 1. It really was not envisioned that non-conforming
implementations would define __STDC__ at all. (But of course the
Standard is technically unable to constrain non-conforming
implementations.)
More information about the Comp.std.c
mailing list