Path: utzoo!utgpu!water!watmath!clyde!burl!codas!ki4pv!tanner From: tanner@ki4pv.uucp (Dr. T. Andrews) Newsgroups: comp.lang.c Subject: Re: exit(-1) Summary: repeat after me: it's the implementor's job to provide environment Keywords: exit, zero Message-ID: <7292@ki4pv.uucp> Date: 19 Jan 88 15:52:34 GMT References: <6935@brl-smoke.ARPA> <7208@ki4pv.uucp> <334@splut.UUCP> Organization: CompuData, DeLand Lines: 32 In article <334@splut.UUCP>, jay@splut.UUCP writes: ) In article <7208@ki4pv.uucp>, tanner@ki4pv.uucp (Dr. T. Andrews) writes: )> [ remarks supporting exit(0) deleted ] ) for(i = 0; i < 100; i++) { ) repeat_after_me('All the world does not run on Unix, either.'); ) } He's right. Much of the world doesn't run unix. Much of the world does run C, however, and that means that somewhere out there we have people implementing C compilers in diverse environments. In fact, I had the pleasure of supporting just such a beast. In one environment where exit status didn't have the same system-defined meaning, I went and did the right thing: I implemented an exit() with the standard (in the old sense, not in the X3J11 sense) meaning. My exit(0) did the right thing; my exit(non_zero) also did the right thing. It seems reasonable that the vax implementor should also take the trouble to do the right thing. If the vax folks wish to do something strange with vms_exit status, then they and the compiler vendor are free to implemnt a VMS-specific exit routine (vms_exit(), perhaps) which supports the funny meanings like "failed, no errors" and "worked, but fatal errors". However, since this code will be VMS specific, the implementation should only affect VMS sites. The rest of the world's code, which uses things like exit(0), exit(1), and of course the ever-popular exit(n_err), should continue to be supported. Perhaps it's time for something like this: for ( i=101 ; --i ; ) repeat_after_me("standards codify existing practice\n"); -- {allegra clyde!codas decvax!ucf-cs ihnp4!codas killer}!ki4pv!tanner