🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4625

Re: Meaning of __STDC__?

#4625
From: Robert Corbett
Date: Sat, 13 Jan 1996 06:08
26 lines
1800 bytes
In article <4d6673$8to@mailgate.bridgewater.ne.hcc.com>,
John W Kennedy <kennedy1@bwmail1.hcc.com> wrote:
>Is there an official statement as to what __STDC__ means?  Does it mean "This
>compiler (in its current operating mode) fully supports ANSI Standard C," or
>does it mean "This compiler (in its current operating mode) disallows all
>extensions to ANSI Standard C."?  In my opinion, common practice and the
>Rationale both support the former, rather than the latter, but is
>there an official ruling?

__STDC__ is almost meaningless.  For a standard C compiler, it is a synonym
for 1.  A compiler that is not standard conformant is free to define __STDC__
to be 1, since the C standard affects only conformant compilers.

The setting of __STDC__ does not prohibit extensions.  The C standard allows
arbitrary extensions provided the compiler issues at least one diagnostic
message for each program that violates a syntax rule or constraint.

The Solaris 2.4 and 2.5 header files use a magic symbol to allow access
to parts of the headers that otherwise would not be accessible in strict
compliant mode.  If the symbol __EXTENSIONS__ is #defined before #including
a header the entire header is read.  No strictly conforming program is
allowed to #define __EXTENSIONS__, but the prohibition is not a constraint.
Therefore, no error message need be issued.

					Sincerely,
					Robert Corbett
Technical Details
Message-ID: <4d7i9r$euv@engnews2.Eng.Sun.COM>
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!lupa!corbett
References: <4d6673$8to@mailgate.bridgewater.ne.hcc.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews2.Eng.Sun.COM!lupa!corbett
From: corbett@lupa.eng.sun.com (Robert Corbett)
Newsgroups: comp.std.c
Subject: Re: Meaning of __STDC__?
Date: 13 Jan 1996 06:08:59 GMT
Organization: Sun Microsystems Computer Corporation
Message-ID: <4d7i9r$euv@engnews2.Eng.Sun.COM>
References: <4d6673$8to@mailgate.bridgewater.ne.hcc.com>
NNTP-Posting-Host: lupa.eng.sun.com