🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3945

Re: EXIT_FAILURE problem

#3945
From: Andy Vesper
Date: Thu, 07 Sep 1995 13:11
21 lines
1717 bytes
tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) wrote:

>_Why_ is it acceptable for 0 to stand for a null pointer constant on a
>machine in which a null pointer is FFFF, _why_ is it understandable for 0 to
>be false and non-zero to be true even on a machine which has `jump _if_ zero'
>as its only machine instruction; and, yet, _why_ is it not acceptable to have
>exit(0) stand for successful exit on an OS where return status of 0 implies
>failure?

A machine that has only one machine instruction (jump if zero)? Doesn't
sound too useful to me. :-)

Of course, the reason that 0 is a null pointer constant and non-zero means
true is historical -- that's what the target machine was like when C
was developed. All other architectures are second class and must jump through
whatever hoops are necessary to allow source code to be copied over,
compiled and run successfully. Likewise, so many programs assumed that
exit(0) was a `successful' exit that the standardizers said `this will work'.

-- 
Andy V (a Digital spoke, not a Digital spokesperson)
Technical Details
Message-ID: <42mr2v$3rq@nntpd.lkg.dec.com>
Path: arc1-ca.pugleaf.net!nntpd.lkg.dec.com!usenet
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42hjuu$4f4@newshost.lanl.gov> <42irjd$jir@caip.rutgers.edu> <42k9vn$5co@newshost.lanl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!nntpd.lkg.dec.com!usenet
From: Andy Vesper <andy.vesper@pko.mts.dec.com>
Newsgroups: comp.std.c
Subject: Re: EXIT_FAILURE problem
Date: 7 Sep 1995 13:11:59 GMT
Organization: Alpha Personal Systems
Message-ID: <42mr2v$3rq@nntpd.lkg.dec.com>
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42hjuu$4f4@newshost.lanl.gov> <42irjd$jir@caip.rutgers.edu> <42k9vn$5co@newshost.lanl.gov>
NNTP-Posting-Host: flounder.eng.pko.dec.com
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (X11; I; OSF1 V3.2 alpha)
X-URL: news:42k9vn$5co@newshost.lanl.gov