__STDC__ and non-strictly conforming ANSI C compilers

Doug Gwyn gwyn at smoke.BRL.MIL
Wed Dec 14 16:29:14 AEST 1988


In article <3236 at pegasus.ATT.COM> hansen at pegasus.att.com writes:
>What do people think a compiler should do with __STDC__ if it is not
>strictly conforming?

Obviously the actual standard cannot constrain nonconforming
implementations.  However, any implementation that defines
__STDC__ at all in a non-conforming mode is doing a severe
disservice to the C programming community.  __STDC__ is
intended to indicate standard conformance, and nothing else,
certainly not "sort of conforming but different in ways I
think you might like, sorry if it breaks your code".

Please don't define __STDC__ at all for non standard-
conforming implementations, even if they provide a lot of
so-called "ANSI C" features.  Programmers are likely to use
either
	#if __STDC__
or
	#ifdef __STDC__
to conditionalize sections of code based on "house C" vs.
"standard C".  In fact I already use the former that way.
I assume full ANSI C conformance when the test 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.



More information about the Comp.std.c mailing list