Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.lang.c Subject: Re: Strange lint mumblings Message-ID: <719@auspex.UUCP> Date: 15 Dec 88 18:34:28 GMT References: <416@marob.MASA.COM> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 26 > exit(0); /* followed immediately by main's closing brace */ > >causes lint to complain: > >(137) warning: main() returns random value to invocation environment See the other article in comp.lang.c/INFO-C about "incorrect" "lint" complaints; the problem is the same - "lint" has no idea that "exit" never returns, and therefore thinks that after it *does* return, "main" returns by "falling off the end". This means it doesn't return a value; in many C implementations, returning from "main" with a particular value causes the process to terminate with the returned value as its exit status. To fix this, either change exit(0); to return 0; (with parentheses added as per local preferences) or add /*NOTREACHED*/ after the "exit(0)".