🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5497

Re: __STDC__ and non-strictly conforming ANSI C compilers

#5497
From: Guy Harris
Date: Thu, 15 Dec 1988 18:54
28 lines
1780 bytes
 >__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".

I'll certainly agree with that for

 >Please don't define __STDC__ at all for non standard-
 >conforming implementations, even if they provide a lot of
 >so-called "ANSI C" features.

There have been reports of a compiler that defines __STDC__ even though
it provides *some*, but not all, ANSI C features; the authors of that
compiler should be horsewhipped.

However, what about a compiler that can be run in at least two modes,
one of which is "strict tight-sphincter ANSI C", meaning "no, there are
NO macros declared, or objects defined, that aren't listed by name in
the ANS, and there are NO other extensions permitted either", and one of
which is "ANSI C plus extensions", e.g. "we define some things in
#include files that may pollute the namespace"?

For instance, consider a program written for a POSIX environment, so
that it might not compile in "strict ANSI C" mode, but written so that
it can use function prototypes if they're present?  Should __STDC__ be
defined by the compiler running in "ANSI C plus extensions" mode, so
that the code can use "__STDC__" to determine whether function
prototypes, or "#" and "##", or... are supported?
Technical Details
Message-ID: <721@auspex.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!auspex!guy
References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!auspex!guy
From: guy@auspex.UUCP (Guy Harris)
Newsgroups: comp.std.c
Subject: Re: __STDC__ and non-strictly conforming ANSI C compilers
Keywords: ANSI C, __STDC__
Message-ID: <721@auspex.UUCP>
Date: 15 Dec 88 18:54:29 GMT
References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL>
Reply-To: guy@auspex.UUCP (Guy Harris)
Organization: Auspex Systems, Santa Clara
Lines: 28