Newsgroups: comp.std.c
Path: utzoo!utgpu!watserv1!watmath!rbutterw
From: rbutterw@watmath.waterloo.edu (Ray Butterworth)
Subject: Re: Want the word on __STDC__
Message-ID: <1991Mar11.193722.20165@watmath.waterloo.edu>
Organization: Math Faculty Computing Facility, University of Waterloo
References: <4755@lib.tmc.edu> <15260@smoke.brl.mil> <4203@lupine.NCD.COM> <15381@smoke.brl.mil> <668288453.3046@mindcraft.com> <2986@cirrusl.UUCP> <1991Mar7.194733.18150@watmath.waterloo.edu> <622@taumet.com>
Date: Mon, 11 Mar 1991 19:37:22 GMT
Lines: 38

In article <622@taumet.com> steve@taumet.com (Stephen Clamage) writes:
>rbutterw@watmath.waterloo.edu (Ray Butterworth) writes:
>>The failure to fully define __STDC__ was obviously a mistake,
>>and some vendors have thoroughly abused it.
>Wait a minute!  My copy of X3.159-1989 says __STDC__ is defined as
>"the decimal constant 1".  That seems about as clear and fully-defined
>as it could be.

By "fully define" I meant that it should mention its intended use
and explicitly forbid other uses.

>From: gwyn@smoke.brl.mil (Doug Gwyn)
>In article <1991Mar7.194733.18150@watmath.waterloo.edu> rbutterw@watmath.waterloo.edu (Ray Butterworth) writes:
>>Perhaps the next version of the standard could denegrate __STDC__
>>and introduce a new definition, say something like
>>   #define __ANSI_X3_159__ 1989
>The real problem is that the standard can constrain only the behavior
>of CONFORMING implementations; nonconforming implementations can do
>whatever they please, including pretending to be standard conformant.

If instead of simply saying that __STDC__ will be 1, the Standard had
explicitly said something like __STDC__ will be 1 for X3.159-1989,
will have other values for later versions of the standard, and all
values of this macro are reserved by the Standard, things would have
been better.  Sure, it could still be abused, but there would be
less justification for the abuse.  Simply saying that it is 1 made
it very easy for some people to interpret this as meaning that
one should define it as something else to indicate non conformance.

>Your suggestions did not address this fundamental problem any better
>than the existing specification for __STDC__ did.  I am of the opinion
>that there is no method by which any standard could solve the problem.

Certainly there is no guaranteed solution, but one can make things
more difficult to abuse.  The name ANSI_X3_159 sort of indicates
that the name belongs to ANSI Standard C.  The current (presumptuous)
name could (and is) easily claimed by anyone else that wants to
declare their version as "standard" (and not necessarily your standard).
