TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Roy McNeill
from: Paul Edwards
date: 1996-09-04 01:59:10
subject: return 0

PE> What are you talking about?  0, EXIT_SUCCESS and EXIT_FAILURE are the ONLY
PE> things you can use.  Anything else is a BUG.  What your compiler does 
PE> about
PE> that BUG is not something that the standard dwells on.  What's the 
PE> problem?

RM> Once you've returned a value, that value is not in the domain of
RM> the C standard, but in the domain of the op system.

Once you've returned either success or failure (the only two choices) to
the operating system, yes, the OS does whatever it wants, e.g. print a
message saying "that was a good program" or "that was a bad
program".

RM> From your other reply, I gather that it's rash to make any
RM> assumption about what a return value means, beyond 0 = success. So

0 = success, EXIT_SUCCESS = success, EXIT_FAILURE = failure.

RM> I should be able to use anything, within sensible limits, provided

NO.  ANYTHING ELSE IS A BUG.

RM> I doc it properly.

If you want to document that your program is broken, yes, that makes a
small amount of sense.  (So long as you're drunk, and thus have an excuse).
 BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.