Must main return a value?
Paul Eggert
eggert at twinsun.com
Sat Jun 29 04:06:36 AEST 1991
steve at taumet.com (Stephen Clamage) writes:
>michi at ptcburp.ptcbu.oz.au (Michael Henning) writes:
>>So it pays to write
>>int main(void) { exit(0); }
>Except that EXIT_SUCCESS need not have the value 0. This might be
>wrong in an ANSI environment.
But section 4.10.4.3 says that exit(0) and exit(EXIT_SUCCESS) have the
same effect even if EXIT_SUCCESS!=0.
Anyway, Posix 1003.1-1990 (section 8.1) says that EXIT_SUCCESS==0,
so hosts where EXIT_SUCCESS!=0 are an endangered species.
More information about the Comp.std.c
mailing list