MSC __STDC__ strange value
Tony Oliver
tony at tcom.stc.co.uk
Sat Dec 9 01:52:30 AEST 1989
In article <22283 at brunix.UUCP> cs169054 at cslab2b.UUCP (Peter Golde) writes:
>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, so
>>Why?
>
>For a simple reason: there is no ANSI standard C yet (at least, last I
>heard.)
> [remainder deleted]
I beg to differ.
I have a copy of the book "Standard C" by P. J. Plauger & Jim Brodie, 1989;
(Microsoft Press, Programmer's Quick Reference Series, ISBN 1-55615-158-6).
The back cover refers to the authors as, respectively,
...secretary of the ANSI-authorised C Programming Language Standards
Committee and convener of the ISO committee on Standard C;
...chairman and convener of the ANSI-authorised C Programming Language
Standards Committee.
The acknowledgements section refers to the "efforts of all the members of X3J11
in producing a standard in the C programming language".
The introduction states
"The Standard C programming language described in this guide
corresponds to the American National Standards Institute (ANSI)
standard for the C language. An identical standard is currently under
consideration by the International Standards Organization (ISO). This
common standard was developed through the joint efforts of the ANSI
authorized C Programming Language Committee X3J11 and the ISO
authorized Committee JTC1 SC22 WG14".
I take all these statements to indicate that, although the ISO standard was (at
the time of publication) still being considered, the ANSI standard was in place
(finalized and complete) and that this book describes conformance to this
standard.
To help with the original query that started this whole ball rolling, I quote
from the Preprocessing section (Predefined Macros subsection):
"The macro __STDC__ expands to the decimal integer constant 1. The
translator [cpp or similar] should provide another value (or leave the
macro undefined) when you invoke it for other than a Standard C
environment". --- my [] brackets ---
I thoroughly recommend this book (a 200-page paperback) and urge any serious C
programmers to obtain a copy. I have had many "definitive" guides and quick
references before, but this one is the works as regards the ANSI (and hopefully
ISO) standard.
As an aside, I wish to point out that I am a novice to USENET and have only
replied to the article in this conference. If anybody knows of another
newsgroup that is sharing this debate (or would be interested anyway) would
they post the above (or a summary) for other users' benefit. Thank-you.
More information about the Comp.lang.c
mailing list