Path: csiph.com!news.mixmin.net!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c
Subject: Re: size_t vs long.
Date: Sun, 04 Dec 2022 06:29:39 -0800
Organization: A noiseless patient Spider
Lines: 87
Message-ID: <86bkoj5jjg.fsf@linuxsc.com>
References: <5a71fdad-b7d6-4b4a-a3ee-c5a9beb75d28n@googlegroups.com> <20221117011851.690@kylheku.com> <02eee7cc-6d03-420f-adf6-d7b87592fe38n@googlegroups.com> <2b19488a-2675-4dfd-9de8-11720bb222a7n@googlegroups.com> <86edtzc8fc.fsf@linuxsc.com> <861qpyddfd.fsf@linuxsc.com> <875yfamy8a.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader01.eternal-september.org; posting-host="a7bd75a4d2e37668b26a7417afa0cbc4"; logging-data="3889924"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX194ALJa5xYRi/btYx31IAXJZZv905IZYBg="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:/9Gmkg/bPjNS+q5dddWxrqo27Qo= sha1:2DQGqSjDKkv7HhiY+Pfgsi7oR8k=
Xref: csiph.com comp.lang.c:168484
Keith Thompson writes:
> Tim Rentsch writes:
>
>> Richard Damon writes:
>>
>>> On 11/19/22 9:42 AM, Tim Rentsch wrote:
>>>
>>>> James Kuyper writes:
>>>>
>>>>> C89 was a US standard. It got taken over by ISO, which released
>>>>> almost exactly the same text as C90. They added 3 sections at the
>>>>> beginning of the standard to meet ISO requirements, which resulted
>>>>> in every section number after that being increased by 3 (which
>>>>> means every single cross-reference had to be updated, too), but it
>>>>> was otherwise almost identical. [...]
>>>>
>>>> For the most part the ISO (C90) standard uses exactly the same
>>>> wording that was used in the ANSI (C89) standard (ignoring
>>>> differences in numbering, like you say). In places though there
>>>> are some non-trivial changes.
>>>
>>> My understanding was that, execpt for the early "boiler-plate" section
>>> added near the beginning which causes the numbering difference, the
>>> rest of the content was adopted verbatim.
>>
>> My observation is this. I have a copy of ansi.c.txt, which is
>> supposed to be a text-based copy of the ANSI C standard (and
>> presumably after the ANSI C standard was ratified). Perusing
>> that document from time to time, and occasionally going back and
>> forth between that and the first ISO C document, I happened to
>> see passages in places that were different between the ANSI
>> document and the ISO document. Indeed most of the text in the
>> two documents is word-for-word identical, which made the few
>> instances where there were discrepancies stand out rather
>> vividly. Unfortunately I remember the fact of there being
>> differences but not where they are specifically. But I am quite
>> sure that I observed some differences in the wordings of the two
>> documents.
>
> Assuming you have the same ansi.c.txt that I have, I believe it's
> a pre-release draft of the 1989 ANSI C standard. The first
> paragraph is:
>
> (This foreword is not a part of American National Standard for
> Information Systems --- Programming Language C, X3.???-1988.)
>
> The "???" and the 1988 date suggest to me that it had not yet been
> finalized.
>
> My original source for the file was
> http://flash-gordon.me.uk/ansi.c.txt
> but it's no longer there -- but a Google search indicates that
> there are copies elsewhere.
>
> I speculate that that explains any differences between ansi.c.txt
> and the ISO C90 standard.
>
> If you can find any specific differences, and if someone out there
> has a copy of the published 1989 ANSI C standard (I don't),
> perhaps we can clear this up.
As long as people generally use ansi.c.txt as a stand-in for the
ANSI C (aka C89) standard, and as long as people generally do not
reference the actual ANSI C document (and TTBOMK both of these
conditions are true), I don't think it makes much difference
whether any changes occurred between ansi.c.txt and C89 or
between C89 and the first ISO C standard (aka C90). Either way,
it's a mistake to think that citations from "C89" (meaning from
the ansi.c.txt document) are always exactly faithful to C90.
As a point of historical interest, it would be interesting to
know which of the two steps had textual changes, and for that
matter whether there may be changes in both steps. Since I don't
have any way of investigating that question (I don't have a copy
of the official ANSI C standard either), I offer no opinion as to
what might be the case. As a rule I don't like to reach even
speculative conclusions without some sort of hard evidence.
I do recognize the possibility that changes between ansi.c.txt
and the official ANSI C document may account for all of the
discrepancies between "C89" and C90, and that the ANSI C standard
might be essentially identical to the ISO C standard (taking into
account section re-numbering, etc). In the future I will try to
remember to put in a note saying that comments made by me about
"C89" are based on ansi.c.txt rather than the official ANSI C
document (of course, unless and until that changes).