Article View: comp.std.c
Article #5495Re: __STDC__ and non-strictly conforming ANSI C compilers
From: Henry Spencer
Date: Thu, 15 Dec 1988 18:38
Date: Thu, 15 Dec 1988 18:38
24 lines
1617 bytes
1617 bytes
In article <9167@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes: >Please don't define __STDC__ at all for non standard- >conforming implementations... >I assume full ANSI C conformance when [#if __STDC__] succeeds. >I don't think I should have to write > #if __STDC__ == 1 >which would force me to perform massive edits when the next >C standard bumps the value of __STDC__ to 2. Uh, Doug, why would you have to write the "== 1"? "#if __STDC__" will fail if __STDC__ is defined as zero. "#ifdef __STDC__" is a different story, mind you, but as I have pointed out in another posting, the difference between the two could be useful. The October draft says "__STDC__ The decimal constant 1, intended to indicate a conforming implementation.". It does not seem to me that defining __STDC__ as 0 for an ANSI-like but non-conforming implementation is *clearly* a violation of this. Furthermore, it would appear to me that only "#if __STDC__" is guaranteed to tell you whether it's a conforming implementation, and "#ifdef __STDC__" should not be relied on, given the existing wording. -- "God willing, we will return." | Henry Spencer at U of Toronto Zoology -Eugene Cernan, the Moon, 1972 | uunet!attcan!utzoo!henry henry@zoo.toronto.edu
Technical Details
Message-ID:
<1988Dec15.183822.2559@utzoo.uucp>Path:
arc1-ca.pugleaf.net!utzoo!henryReferences:
<3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c Path: arc1-ca.pugleaf.net!utzoo!henry From: henry@utzoo.uucp (Henry Spencer) Subject: Re: __STDC__ and non-strictly conforming ANSI C compilers Message-ID: <1988Dec15.183822.2559@utzoo.uucp> Organization: U of Toronto Zoology References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> Date: Thu, 15 Dec 88 18:38:22 GMT