🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4951

Re: EXIT_SUCCES != EXIT_FAILURE?

#4951
From: Bill McCarthy
Date: Tue, 26 Mar 1996 03:43
27 lines
1428 bytes
In <tompa.827763954@news>, tompa@ida.liu.se (Thomas Padron-McCarthy) writes:
>Hi!
>
>Many of the students in a C course I teach have started to use
>EXIT_SUCCESS and EXIT_FAILURE as return values from functions
>(other than main).
>
>I have never used EXIT_SUCCESS and EXIT_FAILURE for anything
>else than as the return value from main, and as the argument to exit.
>
>I don't like this new practice, but questions of style are difficult.
>So I wonder: Does the standard guarantee that EXIT_SUCCESS and
>EXIT_FAILURE are different?
>
>I have looked in my old ANSI X3-159-1989,
>but I guess I'm not smart enough to understand it...

Not only are they not guaranteed to be different.  EXIT_SUCCESS is
not guaranteed to be zero, and EXIT_FAILURE is not guaranteed to
be different from 0.  They are implementation defined and should
only be used as an argument to exit() or in a return from main().

They are defined 7.10.4.3 of the standard.

Bill McCarthy
actuary@nando.net
Wendell, NC  USA
Technical Details
Message-ID: <4j7p4p$4n8@castle.nando.net>
Path: arc1-ca.pugleaf.net!castle.nando.net!news
References: <tompa.827763954@news>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!castle.nando.net!news
From: actuary@nando.net   (Bill McCarthy)
Newsgroups: comp.std.c
Subject: Re: EXIT_SUCCES != EXIT_FAILURE?
Date: 26 Mar 1996 03:43:21 GMT
Organization: Nando.net Public Access
Message-ID: <4j7p4p$4n8@castle.nando.net>
References: <tompa.827763954@news>
Reply-To: actuary@nando.net (Bill McCarthy)
NNTP-Posting-Host: grail806.nando.net
X-Newsreader: IBM NewsReader/2 v1.2