__STDC__ and non-conforming ANSI C compilers

John Gilmore gnu at hoptoad.uucp
Wed Dec 21 22:08:34 AEST 1988


I'm glad to finally see some sense about __STDC__ (Ray Butterworth's).
Doug, you seem to be trying to tell us that ANSI C implementations
should all be worthless because they are so pedantic that they can't be
used.  The code that I have so far written using __STDC__ uses it to
determine whether the historic-C preprocessor was there or whether the
committee-designed preprocessor was there.  This is necessary because
the committee designed a new syntax incompatible with every existing
piece of source code, and disabled the features that old code used.
Now Doug suggests that the only thing that can be relied upon to
distinguish the two environments, be turned off if a minor extension
(like the ability to call open() with either two or three arguments,
without declaring it variadic, or a fortran keyword) is also accepted
by the compiler.

There is probably a use for __STDC__ other than determining whether
you are on an "old" or "ansi" style compiler, but I doubt such uses are
important enough to break the main job of __STDC__.

But most importantly, you can rave all you want about what
non-conforming compilers do with __STDC__, but it's all that much hot
air.  "We don't conform, nyaah." is a perfectly reasonable response.
-- 
John Gilmore    {sun,pacbell,uunet,pyramid,amdahl}!hoptoad!gnu    gnu at toad.com
		"The network *is* the confuser."



More information about the Comp.std.c mailing list