Strange lint mumblings
Gregg Siegfried
grs at alobar.ATT.COM
Thu Dec 15 02:30:21 AEST 1988
In article <416 at marob.MASA.COM> daveh at marob.masa.com (Dave Hammond) writes:
>Can anyone explain why the statement:
> exit(0); /* followed immediately by main's closing brace */
>causes lint to complain:
>(137) warning: main() returns random value to invocation environment
Exit is not part of the C language and appears to lint (and the compiler)
as just another function call. That it happens to free resources, close
files, and run down the process is just a handy coincidence. ;-)
To nuke this message, use return rather than exit. In most Unix environments,
an implicit exit is linked in with crt0 anyway.
>Dave Hammond
Gregg Siegfried
grs at alobar.att.com
More information about the Comp.lang.c
mailing list