Strange lint mumblings
Doug Gwyn
gwyn at smoke.BRL.MIL
Mon Jan 2 12:05:37 AEST 1989
In article <1700 at valhalla.ee.rochester.edu> badri at valhalla.ee.rochester.edu (Badri Lokanathan) writes:
>Alas, some of us (at least I) have gotten used to the easy clean up facility
>that exit() provides. That is, flushing all I/O buffers and closing
>them. return(status) works cleanly if the programmer takes care of
>this.
Oh, come on. Return from main() is ALSO supposed to do this; it's
practically like a coroutine jump to exit() with the return value
being passed to exit as its argument.
The real problem comes when you try to return a non-zero termination
status via "return N;" from main() on a system like some releases of
SunOS where the run-time start-off code has been "hot wired" to force
an exit(0) whenever main returns. That was a mistake that needs to
be fixed, but small consolation if it bites you.
More information about the Comp.lang.c
mailing list