MSC __STDC__ strange value
Doug Gwyn
gwyn at smoke.BRL.MIL
Wed Dec 6 03:58:15 AEST 1989
In article <223 at bohra.cpg.oz> ejp at bohra.cpg.oz (Esmond Pitt) writes:
>For some strange reason, the MSC 5.1 compiler defines __STDC__ as 0 ...
>Why?
Some C compiler vendors seem to think that they're doing the programmer
a favor by predefining __STDC__ to a non-1 value to indicate that their
compiler has "some" standard features but not full compliance. Typical
features so indicated include support for function prototype declarations.
However, since there is no way to tell just what part of the Standard is
conformed to and what part isn't, such non-standard predefinition of
__STDC__ is not very useful and, as you seem to have discovered, can
actually get in the way of the programmer.
We went through a discussion of this problem on comp.std.c several
months ago. The conclusion seemed to be that programmers are going
to have to invent their own symbol (presumably in a local standard
configuration header) to serve the role that X3J11 had intended for
__STDC__. My symbol, defined in <std.h>, is STD_C, and it can be
forcibly configured to indicate the right thing separately for each
supported C environment.
More information about the Comp.lang.c
mailing list