Article View: comp.std.c
Article #3950Re: EXIT_FAILURE problem
From: Peter Seebach
Date: Thu, 07 Sep 1995 17:45
Date: Thu, 07 Sep 1995 17:45
30 lines
1965 bytes
1965 bytes
In article <42mus7$n9o@caip.rutgers.edu>, <halasz@caip.rutgers.edu> wrote: >The error is that the library indeed translated. We hav prevented the >programmer who uzes this system from uzing "exit" for _other_ exit-status >that he knows is to be had on this system. Well, duh. printf() "translates" into local OS calls, too. If you want system calls, you know where to find them. >My concluzion form all this is that if a programmer wants to return >useful exit-status, too bad. *exactly* - portable code cannot return an exit status more specific than "success" or "failure". If you need to do so, the C language cannot help you, so you don't use it - you use an OS extension. But that code *must* be system specific. What you are saying is essentially that it is an error for exit() to have well-defined, portable behavior. This is not true. It is *necessary* for exit to have well defined, portable behavior. If that behavior does not meet your needs, it is your needs themselves which are unportable, and you must resort to the tactics C programmers always use for unportable code - write unportable code. The key is that the unportability of exit codes is an attribute of the OS world, and that C has no power to change it. -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:
<42nb4a$3fk@solutions.solon.com>Path:
arc1-ca.pugleaf.net!solon.com!not-for-mailReferences:
<jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42mta4$2ku@solutions.solon.com> <42mus7$n9o@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 12:45:46 -0500 Organization: Usenet Fact Police (Undercover) Message-ID: <42nb4a$3fk@solutions.solon.com> References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <42mta4$2ku@solutions.solon.com> <42mus7$n9o@caip.rutgers.edu> NNTP-Posting-Host: 192.129.84.3