Article View: comp.std.c
Article #3984Re: EXIT_FAILURE problem
From: Jeremy Fitzhardinge
Date: Wed, 13 Sep 1995 12:40
Date: Wed, 13 Sep 1995 12:40
27 lines
1784 bytes
1784 bytes
In <1995Sep11.221423.6651@forte.com> mikes@forte.com (Mike Schilling) writes: >Why couldn't the standard define another function called, say > > void sys_exit(OS_RET_TYPE) > >which does what exit does in terms of cleanup, and then exits with >OS-specific exit status. The standard couldn't specify the actual type >of OS_RET_TYPE, of course, or how to map OS-specific exit statuses into >C types. Much of the usefulness of sys_exit *would* be a quality of >implementation issue. Still, writing largely portable programs which >use OS-specific features where possible and appropriate would be far eaiser >if this kind of thing were encouraged and where possible mandated. This is getting pretty silly. Why have the standard define something completely undefined? It would be impossible for a conforming program to use such a sys_exit() without knowing what OS_RET_TYPE is, which means it can't be used unless a specific OS is targeted, which means it would be non-portable. There's no point in having the standard define a feature which can't be used portably. The standard defines two states a program can terminate with: success and failure. If you want to communicate a non-standard state to the environment, you have to use a non-standard interface, and have it become a non-conforming program. By definition, the standard doesn't, and shouldn't, cover non-standard interfaces. J
Technical Details
Message-ID:
<jeremy.810996048@suede.sw.oz.au>Path:
arc1-ca.pugleaf.net!swallow.sw.oz.au!jeremyReferences:
<42nsuq$bon@elf.bsdi.com> <1995Sep11.221423.6651@forte.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!swallow.sw.oz.au!jeremy From: jeremy@sw.oz.au (Jeremy Fitzhardinge) Newsgroups: comp.std.c Subject: Re: EXIT_FAILURE problem Date: 13 Sep 95 12:40:48 GMT Organization: Softway Pty Limited Message-ID: <jeremy.810996048@suede.sw.oz.au> References: <42nsuq$bon@elf.bsdi.com> <1995Sep11.221423.6651@forte.com> NNTP-Posting-Host: suede.sw.oz.au