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


Groups > comp.lang.c > #3349

Re: Return value for error

From James Kuyper <jameskuyper@verizon.net>
Newsgroups comp.lang.c
Subject Re: Return value for error
Date 2011-05-05 23:38 -0400
Organization A noiseless patient Spider
Message-ID <ipvqf1$7lc$1@dont-email.me> (permalink)
References <e63ceea9-301d-4b90-9495-4e2a8085fae5@x1g2000yqb.googlegroups.com> <L6OdnYkzV8mMp13QnZ2dnUVZ_tidnZ2d@bestweb.net> <pan.2011.05.05.06.21.52.62000@nowhere.com> <0.4b4500a560ab631222b2.20110505151314BST.87ei4d44n9.fsf@bsb.me.uk> <pan.2011.05.06.02.51.20.843000@nowhere.com>

Show all headers | View raw


On 05/05/2011 10:51 PM, Nobody wrote:
> On Thu, 05 May 2011 15:13:14 +0100, Ben Bacarisse wrote:
...
>> I'll take your word for that, but every conforming implementation does
>> have macros that start with a E and which do include an underscore
>> (EXIT_SUCCESS and EXIT_FAILURE).
> 
> Right. But those *will* exist if <stdlib.h> is included.
> 
> [So does this mean that the standard conflicts with itself? A literal
> reading of 7.26.3 suggests that <errno.h> is allowed to define those
> macros; does this mean that including both <errno.h> and <stdlib.h>
> invokes UB?]

7.1.2p4: "Standard headers may be included in any order; each may be
included more than once in a given scope, with no effect different from
being included only once, except that the effect of including <assert.h>
depends on the definition of NDEBUG (see 7.2)."

This implies that, if <errno.h> and <stdlib.h> both define those macros,
those definitions must be protected against the kinds of problems you're
thinking of. It's not very difficult; they're both "object-like" macros;
so giving both macros the same replacement list is sufficient to satisfy
the "shall" in 6.10.3p2.
-- 
James Kuyper

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


Thread

Return value for error pozz <pozzugno@gmail.com> - 2011-05-03 01:31 -0700
  Re: Return value for error jacob navia <jacob@spamsink.net> - 2011-05-03 10:46 +0200
  Re: Return value for error Ike Naar <ike@otaku.freeshell.org> - 2011-05-03 09:04 +0000
    Re: Return value for error Ian Collins <ian-news@hotmail.com> - 2011-05-03 21:19 +1200
  Re: Return value for error James Kuyper <jameskuyper@verizon.net> - 2011-05-03 06:26 -0400
    Re: Return value for error Keith Thompson <kst-u@mib.org> - 2011-05-03 12:03 -0700
      Re: Return value for error "Kleuskes & Moos" <kleuske@xs4all.nl> - 2011-05-04 05:15 -0700
        Re: Return value for error Keith Thompson <kst-u@mib.org> - 2011-05-04 08:26 -0700
          Re: Return value for error "Kleuskes & Moos" <kleuske@xs4all.nl> - 2011-05-04 17:08 -0700
            Re: Return value for error Keith Thompson <kst-u@mib.org> - 2011-05-04 17:54 -0700
              Re: Return value for error "Kleuskes & Moos" <kleuske@xs4all.nl> - 2011-05-05 12:03 -0700
  Re: Return value for error James Dow Allen <jdallen2000@yahoo.com> - 2011-05-03 03:45 -0700
    Re: Return value for error Jorgen Grahn <grahn+nntp@snipabacken.se> - 2011-05-03 20:50 +0000
  Re: Return value for error pete <pfiland@mindspring.com> - 2011-05-03 07:50 -0400
    Re: Return value for error Keith Thompson <kst-u@mib.org> - 2011-05-03 12:04 -0700
  Re: Return value for error Martin Ambuhl <mambuhl@earthlink.net> - 2011-05-03 07:59 -0400
  Re: Return value for error Mark Storkamp <mstorkamp@yahoo.com> - 2011-05-03 08:46 -0500
  Re: Return value for error Stephen Sprunk <stephen@sprunk.org> - 2011-05-03 10:13 -0500
    Re: Return value for error William Ahern <william@wilbur.25thandClement.com> - 2011-05-03 13:08 -0700
  Re: Return value for error Kenneth Brody <kenbrody@spamcop.net> - 2011-05-03 13:23 -0400
    Re: Return value for error Peter Nilsson <airia@acay.com.au> - 2011-05-03 16:01 -0700
    Re: Return value for error Nobody <nobody@nowhere.com> - 2011-05-05 07:21 +0100
      Re: Return value for error Ben Bacarisse <ben.usenet@bsb.me.uk> - 2011-05-05 15:13 +0100
        Re: Return value for error Nobody <nobody@nowhere.com> - 2011-05-06 03:51 +0100
          Re: Return value for error James Kuyper <jameskuyper@verizon.net> - 2011-05-05 23:38 -0400
      Re: Return value for error Keith Thompson <kst-u@mib.org> - 2011-05-05 08:44 -0700
        Re: Return value for error Seebs <usenet-nospam@seebs.net> - 2011-05-05 20:49 +0000
          Re: Return value for error Keith Thompson <kst-u@mib.org> - 2011-05-05 14:10 -0700
            Re: Return value for error Seebs <usenet-nospam@seebs.net> - 2011-05-06 00:26 +0000
  Re: Return value for error Keith Thompson <kst-u@mib.org> - 2011-05-03 12:09 -0700

csiph-web