🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4634

Re: Meaning of __STDC__?

#4634
From: Henry Spencer
Date: Sat, 13 Jan 1996 22:08
24 lines
1915 bytes
In article <4d6673$8to@mailgate.bridgewater.ne.hcc.com> kennedy1@bwmail1.hcc.com (John W Kennedy) writes:
>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?

There can be no official ruling on behavior that is outside the standard,
such as extensions which do not contravene any of the standard's rules.
ANSI C does not preclude extensions, it only requires that they be invoked
by some mechanism whose semantics are left undefined (or implementation-
defined) by the standard, such as the use of a non-standard #include <>
header-file name. 

Actually, the standard says that __STDC__ is 1 in ANSI C.  It (necessarily)
says nothing about what __STDC__ might or might not be in non-standard C.
So technically you can't draw any conclusions at all from the presence of
__STDC__; the valid conclusion is `standard -> __STDC__', not vice-versa.
Of course, one would hope that most implementors have the sense to define
__STDC__ only when the standard is satisfied, but counterexamples do exist.
-- 
The Earth is our mother.                           |       Henry Spencer
Our nine months are up...                          |   henry@zoo.toronto.edu
Technical Details
Message-ID: <DL545u.MBy%spenford@zoo.toronto.edu>
Path: arc1-ca.pugleaf.net!info.physics.utoronto.ca!utzoo!spenford!henry
References: <4d6673$8to@mailgate.bridgewater.ne.hcc.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c
Path: arc1-ca.pugleaf.net!info.physics.utoronto.ca!utzoo!spenford!henry
From: Henry Spencer <henry@zoo.toronto.edu>
Subject: Re: Meaning of __STDC__?
References: <4d6673$8to@mailgate.bridgewater.ne.hcc.com>
Sender: henry%spenford@zoo.toronto.edu (Henry Spencer)
Organization: SP Systems, Toronto
Date: Sat, 13 Jan 1996 22:08:18 GMT
Message-ID: <DL545u.MBy%spenford@zoo.toronto.edu>