🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5536

Re: __STDC__ and non-conforming ANSI C compilers

#5536
From: Doug Gwyn
Date: Tue, 27 Dec 1988 06:54
49 lines
2786 bytes
In article <6093@hoptoad.uucp> gnu@hoptoad.uucp (John Gilmore) writes:
-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.

To the contrary, I think implementations that conform to the Standard
will be extremely useful.

-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.

That of course is one possible use for __STDC__, but by no means the
only one and probably not the most important one.

-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.

That is of course blatantly false.  I know of an experiment involving
the recompilation of every piece of UNIX system source code using an
experimental (intended to be ANSI-conforming) compiler, and very
little of it was "broken" by the standard-conforming implementation.

Now, code that fully uses the features of ANSI C will not be backward-
portable to non standard-conforming compilers, but that was never a
constraint (and was deemed impossible anyway).

-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.

What's a "minor" violation for you may well be "major" for others.

-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__.

Funny, that's MY argument!

-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.

But subverting features of the Standard specifically designed to be used
by application source code to test for implementation standard conformance
is NOT reasonable; it's some sort of crime.
Technical Details
Message-ID: <9242@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!cmcl2!adm!smoke!gwyn
References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> <22765@watmath.waterloo.edu> <6093@hoptoad.uucp>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!rutgers!cmcl2!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn )
Newsgroups: comp.std.c
Subject: Re: __STDC__ and non-conforming ANSI C compilers
Message-ID: <9242@smoke.BRL.MIL>
Date: 27 Dec 88 06:54:29 GMT
References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> <22765@watmath.waterloo.edu> <6093@hoptoad.uucp>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 49