Article View: comp.os.os2
Article #268Re: MSC __STDC__ strange value
From: Richard H. Gumpertz
Date: Tue, 05 Dec 1989 18:47
Date: Tue, 05 Dec 1989 18:47
26 lines
1999 bytes
1999 bytes
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? On page "Update-54" the manual entry for __STDC__ reads: The integer constant 0. If equal to 1, this macro indicates full compliance with the ANSI proposed standard for the C programming language. I suspect Microsoft extrapolated from the standard's definition of __STDC__ in which future versions may define values such as 2, 3, etc. to mean revised C standards. They extrapolated backward to 0, meaning close to but not fully compliant. A plausible (but strange) hack I suppose. By the way, there is an interesting anomaly: The standard cannot say anything about whether __STDC__ is defined or what its value should be for non-conforming implementations -- it controls only the value for conforming ones! Hence, defining __STDC__ in a non-conforming implementation is perfectly legal so long as conformance is not claimed elsewhere. Of course, no sane implementor of a non-conforming compiler should define it as 1 (or greater, I suppose) unless he wants unhappy customers. Sigh. :-) -- =============================================================================== | Richard H. Gumpertz rhg%cpsolv@uunet.uu.NET -or- ...uunet!amgraf!cpsolv!rhg | | Computer Problem Solving, 8905 Mohawk Lane, Leawood, Kansas 66206-1749 | ===============================================================================
Technical Details
Message-ID:
<461@cpsolv.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde!uunet!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!wuarchive!texbell!attctc!kcdev!pars!cpsolv!rhgReferences:
<223@bohra.cpg.oz>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde!uunet!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!wuarchive!texbell!attctc!kcdev!pars!cpsolv!rhg From: rhg@cpsolv.UUCP (Richard H. Gumpertz) Newsgroups: comp.os.os2,comp.lang.c,comp.std.c Subject: Re: MSC __STDC__ strange value Message-ID: <461@cpsolv.UUCP> Date: 5 Dec 89 18:47:47 GMT References: <223@bohra.cpg.oz> Reply-To: rhg@cpsolv.uucp (Richard H. Gumpertz) Organization: Computer Problem Solving, Leawood, Kansas Lines: 26