Want the word on __STDC__

David Fenyes dfenyes at thesis1.hsch.utexas.edu
Wed Feb 20 10:22:16 AEST 1991


Hello,

Here's the question:

Everybody knows that ANSI C compilers with ANSI preprocessors should
have __STDC__ #defined to 1, and K&R compilers with K&R cpp don't have
__STDC__ #defined at all.

The question is:  Does an ANSI cpp ALWAYS #define __STDC__, even if it
is used intentionally with a K&R compiler (#defined to 0)?
Mark Williams uses an ANSI cpp with their non-ANSI compiler, and
#defines __STDC__ to 0, which causes all sorts of problems when code
tests #ifdef __STDC__  . . . (rather than #if __STDC__).

Who is the offender? MWC, or those #ifdef'ers out there?

It makes sense to #define __STDC__ so the code can take advantage
of the ANSI cpp features, while still not using ANSI prototypes, etc.

If anyone knows the answer from the ANSI documents, please let me
know, or post to the net.  I'd be glad to summarize any info mailed
to me for the net.

Thanks,
David.
--
David Fenyes                                  dfenyes at thesis1.hsch.utexas.edu
University of Texas Medical School            Houston, Texas



More information about the Comp.std.c mailing list