functions that don't return
Ray Butterworth
rbutterworth at watmath.UUCP
Mon Oct 6 23:16:49 AEST 1986
> I think it should be the second choice, main(); exit(0);. The reason
> is two fold. First, unless a program specifically bombs off, it
> should exit with a happy status. Falling off the bottom of main I
> would not consider to be doing anything specific yet the return (and
> exit) value will be random. Second, with a random exit status, it
> makes the program much less usefull. Make(1) will sometimes work and
> sometimes fail, etc.
If you change that to "main(); exit(1);" I'll agree with you.
Programs should definitely not exit with a random status,
but I think we should do as much as possible to encourage the programmer
to be aware that it is his responsibility to return a meaningful status.
More information about the Comp.lang.c
mailing list