🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5522

Re: __STDC__ and non-strictly conforming ANSI C compilers

#5522
From: Colin Plumb
Date: Wed, 21 Dec 1988 10:44
27 lines
1741 bytes
In article <14179@oberon.USC.EDU> english@stromboli.usc.edu (Joe English) writes:
>I'm still unclear on the meaning of __STDC__... does it mean
>"supports prototypes, void, signed, etc.," or "strictly conforming,
>no extensions?"  Or is this not specified?  

It means "will compile any strictly conforming program", strictly conforming
being a program which doesn't use any undefined or implementation-defined
features of the ANSI C standard.

It guarantees that there are no incompatible extensions to the language,
so any program that compiles without the extensions will also compile with
them.  New keywords or identifiers break this badly.

For an example of an extension that is okay with __STDC__=1, try:

anything using @ or $
(since they're not part of the C character set)
int c : 64;
(defining variables in terms of bits)
register int foo();
(e.g. for function inlining)
char x[0];
(as the last element of a struct; I can do malloc(sizeof mystruct + arraysiz);)

or any number of things that don't interfere with existing C.
-- 
	-Colin (uunet!microsof!w-colinp)
Technical Details
Message-ID: <120@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!elroy!orion.cf.uci.edu!ucsd!rutgers!mailrus!cornell!uw-beaver!microsoft!w-colinp
References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> <1988Dec15.183822.2559@utzoo.uucp> <22765@watmath.waterloo.edu> <14179@oberon.USC.EDU>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-lcc!ames!elroy!orion.cf.uci.edu!ucsd!rutgers!mailrus!cornell!uw-beaver!microsoft!w-colinp
From: w-colinp@microsoft.UUCP (Colin Plumb)
Newsgroups: comp.std.c
Subject: Re: __STDC__ and non-strictly conforming ANSI C compilers
Message-ID: <120@microsoft.UUCP>
Date: 21 Dec 88 10:44:51 GMT
References: <3236@pegasus.ATT.COM> <9167@smoke.BRL.MIL> <1988Dec15.183822.2559@utzoo.uucp> <22765@watmath.waterloo.edu> <14179@oberon.USC.EDU>
Reply-To: w-colinp@microsoft.UUCP (Colin Plumb)
Distribution: na
Organization: Microsoft Corp., Redmond WA
Lines: 26
Confusion: Microsoft Corp., Redmond WA