__STDC__ and non-strictly conforming ANSI C compilers

Henry Spencer henry at utzoo.uucp
Fri Dec 16 04:38:22 AEST 1988


In article <9167 at smoke.BRL.MIL> gwyn at 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 at zoo.toronto.edu



More information about the Comp.std.c mailing list