Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!uccba!alobar!grs From: grs@alobar.ATT.COM (Gregg Siegfried) Newsgroups: comp.lang.c Subject: Re: Strange lint mumblings Summary: exit vs return Keywords: lint exit Message-ID: <1037@alobar.ATT.COM> Date: 14 Dec 88 16:30:21 GMT References: <416@marob.MASA.COM> Reply-To: grs@alobar.ATT.COM (Gregg Siegfried) Distribution: na Organization: Home for Future Burnt-out Hackers Lines: 16 In article <416@marob.MASA.COM> daveh@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@alobar.att.com