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


Groups > comp.lang.c > #146048

Re: error_t proposal

From Keith Thompson <kst-u@mib.org>
Newsgroups comp.lang.c
Subject Re: error_t proposal
Date 2019-09-05 15:14 -0700
Organization None to speak of
Message-ID <lnwoemtmpv.fsf@kst-u.example.com> (permalink)
References (2 earlier) <5d70c108$0$14374$426a74cc@news.free.fr> <b2c74983-313a-4bc2-84c7-b294103ac0a7@googlegroups.com> <qkr5fu$1k1$1@dont-email.me> <lnef0uv397.fsf@kst-u.example.com> <qkrvt7$4fg$1@dont-email.me>

Show all headers | View raw


James Kuyper <jameskuyper@alumni.caltech.edu> writes:
> On 9/5/19 5:31 PM, Keith Thompson wrote:
> ...
>> VMS (VAX is the hardware, which can also run Unix) does the same for the
>> return status of a program -- which is probably part of the reason we
>> have the EXIT_SUCCESS and EXIT_FAILURE macros in <stdlib.h>.  When I
>> worked on VMS, I sometimes ran into C programs that used "return 1;" or
>> "exit(1);" to indicate failure, but that indicates success on VMS.
>> 
>> (But "return 0;" or "exit(0);" is required to return a successful
>> status, even though the OS treats that as a failure code.)
>
> "If the value of status is zero or EXIT_SUCCESS, an
> implementation-defined form of the status _successful termination_ is
> returned." (7.20.4.3p5).
> I don't believe that a status which the OS treats as a failure code
> could qualify as a successful status. On a platform where successful
> statuses are indicated by odd values, exit(0) must return an odd status.
>
> "If the return type of the main function is a type compatible with int,
> a return from the initial call to the main function is equivalent to
> calling the exit function with the value
> returned by the main function as its argument; ..." (5.1.2.2.3p1).
> So the same should also be true of "return 0;" from main().

Yes, I didn't mean to imply otherwise.

-- 
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
Will write code for food.
void Void(void) { Void(); } /* The recursive call of the void */

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


Thread

error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-04 14:14 -0700
  Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-04 15:20 -0700
    Re: error_t proposal Mateusz Viste <mateusz@wont.tell> - 2019-09-05 08:02 +0000
      Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 04:04 -0700
        Re: error_t proposal Bruce S <bruces42@hotmail.com> - 2019-09-05 08:18 -0600
          Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-05 14:31 -0700
            Re: error_t proposal James Kuyper <jameskuyper@alumni.caltech.edu> - 2019-09-05 17:49 -0400
              Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-05 15:14 -0700
            Re: error_t proposal Bruce S <bruces42@hotmail.com> - 2019-09-06 14:03 -0600
  Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-05 09:30 +1000
    Re: error_t proposal Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-09-05 02:38 -0700
    Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 04:57 -0700
      Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 05:16 -0700
        Re: error_t proposal Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-09-05 05:35 -0700
          Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 06:08 -0700
            Re: error_t proposal Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-09-05 06:16 -0700
              Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 06:37 -0700
                Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 07:04 -0700
                Re: error_t proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-09-05 20:51 +0100
                Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 13:52 -0700
                Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-05 14:56 -0700
              Re: error_t proposal William Ahern <william@25thandClement.com> - 2019-09-05 13:18 -0700
              Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-06 07:25 +1000
      Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-06 07:35 +1000
        Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-06 04:22 -0700
    Re: error_t proposal scott@slp53.sl.home (Scott Lurndal) - 2019-09-05 13:59 +0000
      Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-06 07:10 +1000
  Re: error_t proposal Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-09-05 10:01 +0000
    Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 04:36 -0700
      Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-05 14:43 -0700
        Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-06 05:01 -0700
          Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-06 11:18 -0700
            Re: error_t proposal scott@slp53.sl.home (Scott Lurndal) - 2019-09-06 19:34 +0000
            Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-06 12:37 -0700
              Re: error_t proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-09-06 20:54 +0100
                Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-06 13:20 -0700
                Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-06 13:43 -0700
                Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-06 14:25 -0700
                Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-06 15:14 -0700
                Re: error_t proposal Keith Thompson <kst-u@mib.org> - 2019-09-06 15:49 -0700
                Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-06 18:44 -0700
                Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-07 12:35 +1000
                Re: error_t proposal Ike Naar <ike@sdf.lonestar.org> - 2019-09-08 20:15 +0000
                Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-09 09:30 +1000
                Re: error_t proposal Ike Naar <ike@iceland.freeshell.org> - 2019-09-09 07:35 +0000
                Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-09 19:44 +1000
                Re: error_t proposal scott@slp53.sl.home (Scott Lurndal) - 2019-09-09 13:58 +0000
                Re: error_t proposal Jorgen Grahn <grahn+nntp@snipabacken.se> - 2019-09-10 14:24 +0000
                Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-11 09:22 +1000
                Re: error_t proposal Malcolm McLean <malcolm.arthur.mclean@gmail.com> - 2019-09-10 16:48 -0700
                Re: error_t proposal Clifford Heath <no.spam@please.net> - 2019-09-11 10:45 +1000
                Re: error_t proposal Ben Bacarisse <ben.usenet@bsb.me.uk> - 2019-09-06 21:47 +0100
  Re: error_t proposal jadill33@gmail.com - 2019-09-05 07:04 -0700
    Re: error_t proposal Thiago Adams <thiago.adams@gmail.com> - 2019-09-05 07:36 -0700
      Re: error_t proposal jadill33@gmail.com - 2019-09-05 08:43 -0700

csiph-web