Article View: comp.std.c
Article #3865Re: EXIT_FAILURE problem
From: halasz
Date: Sat, 26 Aug 1995 03:22
Date: Sat, 26 Aug 1995 03:22
28 lines
1902 bytes
1902 bytes
In article <41apqg$6qg@Radon.Stanford.EDU>, becker@Xenon.Stanford.EDU (Denizen of the Deep) writes + .... + There is no way that the standard for the C language can predict all + the ways in which an OS expects to be notified of status. Yes. + All it can do is come up with some uniform way of indicating status, and + then let the OS/startup code intrpret that uniformly specified value, + translating it into the OS's "native" status format if necessary. No, the standard can _hide_ the types and valus, thereby letting the C-programmer doo that which the standard nou forbids, uze a nativ exit-status, integer, string, record, what not. It is forbiddent by the requirement that "exit(0)" hav a particular meaning. This is C, you know, not a reallie high-levvel language, and this puts the C-program too far from the OS. + Why do you keep insisting that this is the case, when it so clearly is + not? If exit(0) is defined to have the exact same effect as + exit(EXIT_SUCCESS), then how can one be portable and not the other? As aforesaid + exit(0) does NOT mean that a 0 is specified to the OS as the status; + it means that success is specified to the OS, in whatever form that + may take (with some form of translation taking place, if necessary). This is not C. + .... + The only caveat is that exit(2) will have different meaning for a + different OS. A further one is needed, that the type of the argument to "exit", and the return-type of "main", is defind by the implementation.
Technical Details
Message-ID:
<41m40r$39q@caip.rutgers.edu>Path:
arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mailReferences:
<jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <41apqg$6qg@Radon.Stanford.EDU>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: 25 Aug 1995 23:22:03 -0400 Organization: Rutgers University Message-ID: <41m40r$39q@caip.rutgers.edu> References: <jbundyDCw7uo.9sz@netcom.com> <danpop.807723059@rscernix> <41apqg$6qg@Radon.Stanford.EDU> NNTP-Posting-Host: caip.rutgers.edu