🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #3947

Re: EXIT_FAILURE problem

#3947
From: Peter Seebach
Date: Thu, 07 Sep 1995 13:49
52 lines
2806 bytes
In article <42lkqd$ngg@caip.rutgers.edu>,  <halasz@caip.rutgers.edu> wrote:
>Unhappilie, the programmer needs the type passd to "exit" and the
>return-type of "main" also hidden, for not all systems (it has been
>pointed out) uze a form of 'int'.

I think you've just never read a word of what anyone's said here.
Consider:

_lib_startup() {
	exit(main(magic, magic));
}

exit(int x) {
if (x == 0) exits("okay");
else exits("not-so-ok");
}

Boom.  We have adapted to a system where we exit with strings.
The library can go further, but who cares?  We've
shown that the library can translate.  Tell us, most omniscient,
how this doesn't work.

>On a new topic, "EXIT_SUCCESS" and "EXIT_FAILURE" are not enough.  In
>practice Unix limits itself to 0, 1, and seldom 2, but four degrees are
>not rare; that is, also "EXIT_WARNING" if the program detects a lesser
>degree of truoble, and "EXIT_ERLIE" or "EXIT_ABORT" if the error is so
>bad that the program bails out.  When under Unix a program uzes 2 it
>uzuallie means the last.  Both VMS and the Guardian uze thismanie
>degrees, and more.

Sure, but some systems have *no* meaningful values.  The standard has
provided enough for 90% of applications; if you want more, *YOUR CODE
IS UNPORTABLE ANYWAY*.  You *CAN'T* write a "custom" exit routine that
does better.  No matter what.  There exists at least one system with
no statii to check; on this system, you can't translate *any* value
meaningfully. I can't see why you're so obsessed with the idea that
library functions map immediately to underlying system functionality; why not
complain that there aren't library calls provided that use the Blitter, while
you're at it?

And please use modern English spelling.  If you object to these changes of the
last few hundred years, petition a standards committee.  In the meantime,
you're gratuitously making your posts difficult to read.  (And that's for a
native speaker who can read at least some Middle English; it's presumably much
worse for the people to whom it is a second, third, ... nth language.)

-s
-- 
Peter Seebach - seebs@solon.com || seebs@intran.xerox.com --
C/Unix proto-wizard -- C/Unix questions? Send mail for help.  No, really!
Copyright 1995 Peter Seebach.  Like my work?  Send donations!
The *other* C FAQ - ftp taniemarie.solon.com /pub/c/afq
Technical Details
Message-ID: <42mta4$2ku@solutions.solon.com>
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42k9vn$5co@newshost.lanl.gov> <42lkqd$ngg@caip.rutgers.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!solon.com!not-for-mail
From: seebs@solutions.solon.com (Peter Seebach)
Newsgroups: comp.std.c
Subject: Re: EXIT_FAILURE problem
Date: 7 Sep 1995 08:49:56 -0500
Organization: Usenet Fact Police (Undercover)
Message-ID: <42mta4$2ku@solutions.solon.com>
References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42k9vn$5co@newshost.lanl.gov> <42lkqd$ngg@caip.rutgers.edu>
NNTP-Posting-Host: solutions.solon.com