🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5591

Re: __STDC__ and non-conforming ANSI C compilers

#5591
From: Doug Gwyn
Date: Mon, 16 Jan 1989 15:21
24 lines
1595 bytes
In article <2788@mhres.mh.nl> jv@mhres.mh.nl (Johan Vromans) writes:
>From article <9369@smoke.BRL.MIL>, by gwyn@smoke.BRL.MIL (Doug Gwyn ):
>> Apart from screaming at MicroSoft about this brain damage, I guess we
>> all have now been forced to use "#if __STDC__" to survive that stupid
>> decision.
>... which will yield a nice warning "__STDC__ not defined,
>treated as zero" in at least one C implementation I know.

Strange implementation, but at least you can ignore such warnings.
If this becomes a real problem for you, you can use
	#if defined(__STDC__) && __STDC__
but then there are C implementations that don't allow defined() to
be used in expressions, if at all, so the next attempt is
	#ifdef __STDC__
	#if __STDC__
but if somebody's implementation stupidly #defines __STDC__ as the
symbol "almost" then you're completely out of luck.

Obviously the original desire for
	#ifdef __STDC__
to work right is a sensible desire; it avoids the warnings you
mention without causing any other problems, IF the compiler vendors
would get their act together and not #define __STDC__ unless they
(fully) conform to the Standard.
Technical Details
Message-ID: <9392@smoke.BRL.MIL>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!uflorida!haven!adm!smoke!gwyn
References: <9369@smoke.BRL.MIL> <2788@mhres.mh.nl>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ames!mailrus!uflorida!haven!adm!smoke!gwyn
From: gwyn@smoke.BRL.MIL (Doug Gwyn )
Newsgroups: comp.std.c
Subject: Re: __STDC__ and non-conforming ANSI C compilers
Message-ID: <9392@smoke.BRL.MIL>
Date: 16 Jan 89 15:21:36 GMT
References: <9369@smoke.BRL.MIL> <2788@mhres.mh.nl>
Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) <gwyn>)
Organization: Ballistic Research Lab (BRL), APG, MD.
Lines: 24