🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5589

Re: __STDC__ and non-conforming ANSI C compilers

#5589
From: Colin Plumb
Date: Mon, 16 Jan 1989 00:08
19 lines
1403 bytes
gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>) wrote:
> I maintain that predefining __STDC__ is a mistake, except when the
> implementation conforms to the Standard (in which case __STDC__ is
> necessarily preset to 1, for the current standard, or some number
> greater than 1, presumably, for a future compatible standard).
> There is no way you can know what use a programmer is making of
> __STDC__.  In fact your guess was wrong for some of the code we
> have..

True, but if the programmer is really exercising the ANSI C standard, they'll
know about the __STDC__ == 1 (#if __STDC__ is shorter, anyway!) and won't
get caught.  But if, as is very popular, they use ##ifdef __STDC__ as a
switch to tell whether to use ANSI cpp-isms or Reiser tricks for
token-pasting, or whether they can include prototypes, or use void *, etc.,
it'll work.

It seems like a reasonable convention to me.
-- 
	-Colin (uunet!microsof!w-colinp)
Technical Details
Message-ID: <274@microsoft.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!uw-beaver!microsoft!w-colinp
References: <898@ubu.warwick.UUCP> <264@microsoft.UUCP> <9371@smoke.BRL.MIL>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!attcan!uunet!lll-winken!lll-lcc!ames!mailrus!cornell!uw-beaver!microsoft!w-colinp
From: w-colinp@microsoft.UUCP (Colin Plumb)
Newsgroups: comp.std.c
Subject: Re: __STDC__ and non-conforming ANSI C compilers
Message-ID: <274@microsoft.UUCP>
Date: 16 Jan 89 00:08:46 GMT
References: <898@ubu.warwick.UUCP> <264@microsoft.UUCP> <9371@smoke.BRL.MIL>
Reply-To: w-colinp@microsoft.uucp (Colin Plumb)
Organization: very little
Lines: 19