🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3930

Re: EXIT_FAILURE problem

#3930
From: halasz
Date: Wed, 06 Sep 1995 00:56
35 lines
2377 bytes
In article <42hjuu$4f4@newshost.lanl.gov>, tanmoy@qcd.lanl.gov (Tanmoy Bhattacharya) writes
: No it doesn't any more than it mandates that a null pointer is all bits zero
: (because char *ptr=0 is allowed), or that it mandates that char and float
: have the same representation (because float x='\0') is allowed.
Meaningless analogie.

: `exit' is a function in the C library and parameters to it can be
: freely specified by the C standard.
Yes, and there is also a function calld "sin", and the standard is free
to declare it a random-number generator.
: In particular, this parameter need not have anything to do
: with what the operating systems calls the exit status, error level,
: return code or whatever else (except semantically).
Quite tru, and mothing mandates that the standard describe anithing
whatsoevver useful.
: This parameter currently either implies success or failure, or implies an
: implementation defined status. 
No: it describes success, failure, and 0.

: I too believe the standard got it wrong: No macros were ever needed :-)
: exit(0) for success and exit(1) for failure and all other values
: implementation defined would have avoided a lot of this needless confusion.
What confuzion, except among those who chooz not to understand that use of
constants in such contexts as this has nothing good to sai for it?
Carrieing out your suggestion would mean that no program with more than
passind use of exit-status would uze "exit".  Instead, the programmer writes
his own system-dependent one, that turns the exit-status that he wishes his
program to return into the real exit-status by calling the relevant
system-dependent exit-routine.

: (By the way, why wasn't this solution chosen? Was there a vast amount of code
: which used exit(1) for some kind of success?)
Doubtless becauz the standard writers know more than you.  But sumone wrote
that that was (pointless) backward compatibilitie with all the (Unix-)
software that had it.
Technical Details
Message-ID: <42irjd$jir@caip.rutgers.edu>
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42hjuu$4f4@newshost.lanl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail
From: halasz@caip.rutgers.edu
Newsgroups: comp.std.c
Subject: Re: EXIT_FAILURE problem
Date: 5 Sep 1995 20:56:13 -0400
Organization: Rutgers University
Message-ID: <42irjd$jir@caip.rutgers.edu>
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42hjuu$4f4@newshost.lanl.gov>
NNTP-Posting-Host: caip.rutgers.edu