__STDC__ and non-strictly conforming ANSI C compilers
Doug Gwyn
gwyn at smoke.BRL.MIL
Sat Dec 17 07:33:04 AEST 1988
In article <1988Dec15.183822.2559 at utzoo.uucp> henry at utzoo.uucp (Henry Spencer) writes:
-In article <9167 at smoke.BRL.MIL> gwyn at brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) writes:
->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.
It was suggested that __STDC__ be given values other than 0 or 1,
which is what I was addressing with the above comment,
-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.
Actually, nothing at all can be relied on in a non standard-conforming
environment, including __STDC__ differing from 1! That's what we're
discussing! I don't want __STDC__ to even be defined -- no matter what
its value -- in a non standard-conforming environment. I've made the
arguments for that previously and shouldn't have to repeat them here.
More information about the Comp.std.c
mailing list