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


Groups > comp.lang.c > #9445

Re: Random thought -- EOF and errno

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: Random thought -- EOF and errno
Date 2011-08-15 12:18 -0700
Organization None to speak of
Message-ID <lnzkja1o15.fsf@nuthaus.mib.org> (permalink)
References <uKmdnfF9KuyE0tjTnZ2dnUVZ_rWdnZ2d@bestweb.net> <j23kdn$d9i$3@dont-email.me> <0.03d9cfe7c11f159d377c.20110813001241BST.87k4aijkba.fsf@bsb.me.uk> <j24hqu$o54$1@dont-email.me> <WPSdnQu4Qqel8NTTnZ2dnUVZ_ridnZ2d@bestweb.net>

Show all headers | View raw


Kenneth Brody <kenbrody@spamcop.net> writes:
> On 8/12/2011 8:51 PM, James Kuyper wrote:
>> On 08/12/2011 07:12 PM, Ben Bacarisse wrote:
>>> James Kuyper<jameskuyper@verizon.net>  writes:
>> ....
>>>> Those macros are reserved for use by the implementation; EOF is #defined
>>>> by the implementation; there's no conflict. In principle, EOF could even
>>>> be a valid errno value.
>>>
>>> I'm not sure it could be (or at least not in a useful way).  7.5p3 says
>>> that errno "is set to a positive error number by several library
>>
>> Sorry - I'd forgotten that the errno values were required to be
>> positive. It's not a fact I've ever had any need to know. In fact, it's
>> not clear to me what advantage there is in requiring them to be positive.
>
> Furrfu, I post some random thought on Friday, and I come back on
> Monday to find a huge thread discussing it.
>
> Anyway, does the Standard say that E* macros must be positive?  All I
> see in that quote is that errno "is set to a positive error number".
> (My copy of N1256 says "errno may be set to nonzero by a library
> function call", without mention of "positive error number".  Was this
> changed in the final wording?) Can <errno.h> define non-positive
> values, as long as errno is never set to that value?  (Hey, this
> started with an insane implementation using EOF as an error number.
> Perhaps the implementer was a bit more insane than we originally
> thought.  Though I don't see "#define ENONE 0" as too weird.)

(I think I already mentioned this.)

It requires that EDOM, EILSEQ, and ERANGE must be distinct and positive.

It says nothing specific about any other implementation-defined E*
macros defined in <errno.h> -- not even that they're error codes.
(Remember, we're talking about hypothetical insane implementations.)

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Nokia
"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

Random thought -- EOF and errno Kenneth Brody <kenbrody@spamcop.net> - 2011-08-12 12:04 -0400
  Re: Random thought -- EOF and errno James Kuyper <jameskuyper@verizon.net> - 2011-08-12 12:27 -0400
    Re: Random thought -- EOF and errno Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-13 00:12 +0100
      Re: Random thought -- EOF and errno Keith Thompson <kst-u@mib.org> - 2011-08-12 16:30 -0700
        Re: Random thought -- EOF and errno Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-13 01:27 +0100
          Re: Random thought -- EOF and errno Keith Thompson <kst-u@mib.org> - 2011-08-12 18:28 -0700
            Re: Random thought -- EOF and errno Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-13 14:38 +0100
              Re: Random thought -- EOF and errno Keith Thompson <kst-u@mib.org> - 2011-08-13 11:50 -0700
                Re: Random thought -- EOF and errno Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-13 17:45 -0400
                Re: Random thought -- EOF and errno Keith Thompson <kst-u@mib.org> - 2011-08-13 18:04 -0700
                Re: Random thought -- EOF and errno Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-13 22:53 +0100
                Re: Random thought -- EOF and errno Keith Thompson <kst-u@mib.org> - 2011-08-13 17:57 -0700
                Re: Random thought -- EOF and errno Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-08-13 21:06 -0400
                Re: Random thought -- EOF and errno Keith Thompson <kst-u@mib.org> - 2011-08-13 18:39 -0700
                Re: Random thought -- EOF and errno Tim Rentsch <txr@alumni.caltech.edu> - 2011-09-04 12:59 -0700
      Re: Random thought -- EOF and errno James Kuyper <jameskuyper@verizon.net> - 2011-08-12 20:51 -0400
        Re: Random thought -- EOF and errno Nobody <nobody@nowhere.com> - 2011-08-13 05:55 +0100
          Re: Random thought -- EOF and errno Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-13 14:49 +0100
        Re: Random thought -- EOF and errno Kenneth Brody <kenbrody@spamcop.net> - 2011-08-15 15:02 -0400
          Re: Random thought -- EOF and errno Keith Thompson <kst-u@mib.org> - 2011-08-15 12:18 -0700
          Re: Random thought -- EOF and errno James Kuyper <jameskuyper@verizon.net> - 2011-08-15 21:54 -0400
            Re: Random thought -- EOF and errno Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-08-16 04:21 +0100
        Re: Random thought -- EOF and errno William Ahern <william@wilbur.25thandClement.com> - 2011-08-15 12:56 -0700
  Re: Random thought -- EOF and errno Seebs <usenet-nospam@seebs.net> - 2011-08-12 18:37 +0000
  Re: Random thought -- EOF and errno Nobody <nobody@nowhere.com> - 2011-08-13 06:00 +0100
    Re: Random thought -- EOF and errno Kenneth Brody <kenbrody@spamcop.net> - 2011-08-15 15:05 -0400
      Re: Random thought -- EOF and errno Keith Thompson <kst-u@mib.org> - 2011-08-15 12:14 -0700
      Re: Random thought -- EOF and errno gordonb.gl0ml@burditt.org (Gordon Burditt) - 2011-08-16 04:31 -0500

csiph-web