Path: utzoo!attcan!uunet!vsedev!logan From: logan@vsedev.VSE.COM (James Logan III) Newsgroups: comp.lang.c Subject: Re: Strange lint mumblings Message-ID: <1286@vsedev.VSE.COM> Date: 17 Dec 88 01:45:19 GMT References: <416@marob.MASA.COM> Reply-To: logan@vsedev.VSE.COM (James Logan III) Organization: VSE Software Development Lab Lines: 32 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: # # ma-main.c # ============== # (137) warning: main() returns random value to invocation environment Lint does not realize that exit() does not return control back to the function main(). Since you don't have "return " as the last statement, Lint thinks the return value of main() would be undefined. If you want lint to stop whining about it, change the last few lines to: exit(0); /*NOTREACHED*/ } Don't ask me to give you a good reason for why lint doesn't know about exit(); there is none. -Jim -- Jim Logan logan@vsedev.vse.com (703) 892-0002 uucp: ..!uunet!vsedev!logan inet: logan%vsedev.vse.com@uunet.uu.net