Path: utzoo!attcan!uunet!lll-winken!lll-tis!ames!mailrus!tut.cis.ohio-state.edu!bloom-beacon!bu-cs!dartvax!eleazar.dartmouth.edu!earleh From: earleh@eleazar.dartmouth.edu (Earle R. Horton) Newsgroups: comp.lang.c Subject: Re: Strange lint mumblings Message-ID: <11467@dartvax.Dartmouth.EDU> Date: 14 Dec 88 14:50:05 GMT References: <416@marob.MASA.COM> Sender: news@dartvax.Dartmouth.EDU Reply-To: earleh@eleazar.dartmouth.edu (Earle R. Horton) Organization: Dartmouth College, Hanover, NH Lines: 28 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 Syntactically, "exit(0)" is a function call. How the heck do you expect lint to know that exit() never returns? Since main() is usually declared to be of type int, then lint is fully justified in expecting to see a "return " at the end of main(). You will have to either live with the lint warning, or cause main() to return something. How about: return(exit(0)); } That should keep lint happy! Earle R. Horton. 23 Fletcher Circle, Hanover, NH 03755 (603) 643-4109 Graduate student.