Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #104280

Re: Using fread function

Path csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Using fread function
Date Mon, 20 Feb 2017 09:52:08 -0800
Organization None to speak of
Lines 63
Message-ID <lnd1ecn41j.fsf@kst-u.example.com> (permalink)
References <02c75a0c-84d7-4669-8bde-472730c7f8d3@googlegroups.com> <79af9f0c-d7e1-ef68-d186-f1ce0baa9e6c@verizon.net> <kfnefzhd13n.fsf@x-alumni2.alumni.caltech.edu> <05a6afe0-d7db-4877-a244-1c5c7bc8e928@googlegroups.com> <kfn37fn7ve2.fsf@x-alumni2.alumni.caltech.edu> <28dc26c8-8063-4334-9850-b1a5ba7876f3@googlegroups.com> <d0e4b764-cef7-41d1-af6c-9b71a2ae323c@googlegroups.com> <kfno9y72twm.fsf@x-alumni2.alumni.caltech.edu> <e26967e5-4cbd-4261-aea0-381fd36a0496@googlegroups.com> <kfn4lzpwia8.fsf@x-alumni2.alumni.caltech.edu> <ca025bfd-538e-462a-8709-aaa9aa0c5479@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Injection-Info mx02.eternal-september.org; posting-host="9029eb194d173f90c26f49eb1843bbfe"; logging-data="9995"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19rdfy92895y3AEQ0yK9Aji"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)
Cancel-Lock sha1:KNTrBMmbl2JMoDH+ccIrbSZZyRE= sha1:ijvEolTRAofURelf4TDw3QQLLCY=
Xref csiph.com comp.lang.c:104280

Show key headers only | View raw


supercat@casperkitty.com writes:
> On Sunday, February 19, 2017 at 11:19:50 PM UTC-6, Tim Rentsch wrote:
>> supercat writes:
>> > The "language" in which Strictly Conforming programs can be written may be
>> > usable for some purposes, but it is totally unsuitable for most of the
>> > tasks which are performed by programs written in various dialects of C.
>> 
>> You are confusing two different classes of program here, to wit,
>> programs that are written in standard C, and programs that are
>> strictly conforming.  My comment is about standard C, not about
>> C programs that are strictly conforming.
>
> The Standard defines two classes of programs: those which are Strictly
> Conforming, and those which are Conforming but not Strictly Conforming.
> I would interpret the class of "Strictly Conforming" programs as including
> some which make use of some implementation-defined behaviors but will meet
> their stated requirements with any combination of such behaviors that
> conforming implementations could define (and thus to not rely upon any
> Implementation Defined behaviors being defined in any *particular* fashion).

Isn't it simpler (and more accurate) just to use the definition in the
standard?

    A strictly conforming program shall use only those features
    of the language and library specified in this International
    Standard. It shall not produce output dependent on any
    unspecified, undefined, or implementation-defined behavior,
    and shall not exceed any minimum implementation limit.

A program that's required to print the value of INT_MAX will meet its
stated requirement, but it cannot be strictly conforming because its
output depends on something that's implementation-defined.  (I'm
assuming that the implementation-defined value of INT_MAX constitutes
implementation-defined behavior.  If not, it shouldn't be difficult to
construct another example.)

Strict comformance is, as the name implies, a strict requirement, one
that most programs don't meet.

A "conforming program" is "one that is acceptable to a conforming
implementation".  This includes programs that depend on
implementation-specific extensions, or even on undefined behavior.
Since a conforming implementation may *accept* a program containing `i =
i++`, such a program can be "conforming".  It is an almost uselessly
wide category.

> The Standard does not define any category of "Standard C" programs other
> than the above, and the category of "Conforming" programs is so broad that
> I don't think all such programs can be meaningfully described as being in
> the same language, so if you're not referring to the category of "Strictly
> Conforming" programs extended as above, to what are you referring?

There's also this (4p3):

    A program that is correct in all other aspects, operating on correct
    data, containing unspecified behavior shall be a correct program and
    act in accordance with 5.1.2.3.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Working, but not speaking, for JetHead Development, Inc.
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Using fread function janus <emekamicro@gmail.com> - 2017-01-29 10:07 -0800
  Re: Using fread function "James R. Kuyper" <jameskuyper@verizon.net> - 2017-01-29 14:31 -0500
    Re: Using fread function supercat@casperkitty.com - 2017-01-30 08:03 -0800
    Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-01 13:59 -0800
      Re: Using fread function jameskuyper@verizon.net - 2017-02-05 11:40 -0800
        Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-08 22:04 -0800
          Re: Using fread function jameskuyper@verizon.net - 2017-02-09 05:39 -0800
            Re: Using fread function supercat@casperkitty.com - 2017-02-09 07:47 -0800
              Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-02-09 09:19 -0800
                Re: Using fread function supercat@casperkitty.com - 2017-02-09 09:55 -0800
                Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-02-09 12:10 -0800
                Re: Using fread function supercat@casperkitty.com - 2017-02-09 13:01 -0800
              Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-12 09:36 -0800
                Re: Using fread function supercat@casperkitty.com - 2017-02-12 10:52 -0800
                Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-19 21:19 -0800
                Re: Using fread function supercat@casperkitty.com - 2017-02-20 09:35 -0800
                Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-02-20 09:52 -0800
                Re: Using fread function supercat@casperkitty.com - 2017-02-20 11:15 -0800
                Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-02-20 11:45 -0800
                Re: Using fread function "James R. Kuyper" <jameskuyper@verizon.net> - 2017-02-20 15:38 -0500
                Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-23 12:12 -0800
                Re: Using fread function jameskuyper@verizon.net - 2017-02-24 10:37 -0800
                Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-23 05:04 -0800
                Re: Using fread function supercat@casperkitty.com - 2017-02-23 07:58 -0800
                Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-25 11:48 -0800
                Re: Using fread function jameskuyper@verizon.net - 2017-02-25 13:44 -0800
                Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-04-17 13:12 -0700
                Re: Using fread function supercat@casperkitty.com - 2017-04-17 13:50 -0700
            Re: Using fread function Tim Rentsch <txr@alumni.caltech.edu> - 2017-02-12 09:31 -0800
  Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-01-29 13:14 -0800
  Re: Using fread function Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-01-30 08:18 -0800
    Re: Using fread function supercat@casperkitty.com - 2017-01-30 08:44 -0800
    Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-01-30 11:58 -0800
      Re: Using fread function Malcolm McLean <malcolm.mclean5@btinternet.com> - 2017-01-30 13:05 -0800
        Re: Using fread function supercat@casperkitty.com - 2017-01-30 13:39 -0800
        Re: Using fread function Keith Thompson <kst-u@mib.org> - 2017-01-30 13:57 -0800

csiph-web