🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4005

Re: EXIT_FAILURE problem

#4005
From: Richard A. O'Keefe
Date: Mon, 11 Sep 1995 08:07
34 lines
2434 bytes
halasz@caip.rutgers.edu writes:

>In article <42eeoo$foo@goanna.cs.rmit.edu.au>, ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) writes
>: This is a perfect example of why the C standard got it just right.

>Can't be, for the standard makes the mistake of specifying a real constant,
>to wit 0, for to mean a particular status, instead of hiding it all under
>macros, EXIT_SUCCESS, EXIT_FAILURE, and so on.

It is no more a mistake for the standard to specify the effect of exit(0)
than it is for the standard to specify the effect of fopen(..., "r").  In
both cases, the function in question is *exclusively* in the domain of
the C standard -- there have been operating systems in which there was
no function even remotely comparable to exit(), and in which the C runtime
library would have had to use longjmp() to implement it.

Let's face it, there are very few aspects of the C standard library that I
would care to defend *in a new language*.  But it was not the purpose of
X3J11 to design a new language; only to extend the utility of an existing
one.  What *was* standard *became* standard, and exit(0) was portable to
every C implementation I've ever heard of except one; for the C community
as a whole it was less cost and more benefit to amend that one implementation
than to change untold thousands of otherwise sensible programs.

Don't you just love the way he says "can't be" without even examining the
evidence?  Nice to _know_ you are right.  Look, I have enough trouble (still)
fixing old (pre-standard) code calling exit(-1) that I will thank you to
leave exit(0) alone.  One more "everyone is out of step but me" and I'll
add a name to my kill file.

-- 
"conventional orthography is ... a near optimal system for the
 lexical representation of English words." Chomsky & Halle, S.P.E.
Richard A. O'Keefe; http://www.cs.rmit.edu.au/~ok; RMIT Comp.Sci.
Technical Details
Message-ID: <430qo4$17t@goanna.cs.rmit.edu.au>
Path: arc1-ca.pugleaf.net!goanna.cs.rmit.edu.au!not-for-mail
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42eeoo$foo@goanna.cs.rmit.edu.au> <42fv9f$ld2@caip.rutgers.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!goanna.cs.rmit.edu.au!not-for-mail
From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe)
Newsgroups: comp.std.c
Subject: Re: EXIT_FAILURE problem
Date: 11 Sep 1995 18:07:32 +1000
Organization: Comp Sci, RMIT, Melbourne, Australia
Message-ID: <430qo4$17t@goanna.cs.rmit.edu.au>
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42eeoo$foo@goanna.cs.rmit.edu.au> <42fv9f$ld2@caip.rutgers.edu>
NNTP-Posting-Host: goanna.cs.rmit.edu.au
NNTP-Posting-User: ok
X-Newsreader: NN version 6.5.0 #0 (NOV)