Xref: utzoo comp.os.os2:363 comp.lang.c:24412 comp.std.c:2255 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!aplcen!haven!purdue!bu-cs!bloom-beacon!eru!luth!sunic!mcsun!ukc!stc!tony From: tony@tcom.stc.co.uk (Tony Oliver) Newsgroups: comp.os.os2,comp.lang.c,comp.std.c Subject: Re: MSC __STDC__ strange value Summary: ANSI Standard for C exists Message-ID: <1311@islay.tcom.stc.co.uk> Date: 8 Dec 89 14:52:30 GMT References: <223@bohra.cpg.oz> <22283@brunix.UUCP> Reply-To: tony@htc1.UUCP (Tony Oliver) Organization: STC Telecomms, Harlow Technical Centre, Harlow Lines: 57 In article <22283@brunix.UUCP> cs169054@cslab2b.UUCP (Peter Golde) writes: >In article <223@bohra.cpg.oz> ejp@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.