Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!uflorida!haven!vrdxhq!bms-at!stuart From: stuart@bms-at.UUCP (Stuart Gathman) Newsgroups: comp.lang.c Subject: Re: Strange lint mumblings Summary: exit is a 'goto' function Message-ID: <138@bms-at.UUCP> Date: 19 Dec 88 20:16:57 GMT References: <416@marob.MASA.COM> Organization: Business Management Systems, Inc., Fairfax, VA Lines: 19 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? Lint does not know that exit(int) is an example of a 'goto' function, i.e. a function that never returns. Someone suggested on the net that 'goto' should be used in a manner similar to 'void' in function declarations of exit(), longjmp(), and friends to indicate this. The compiler could then generate better code (use goto instead of call, don't bother popping arguments, no need to flush cached variables, etc.). For now, lint recognizes a magic comment, "/*NOTREACHED*/" which should follow exit() in your example. -- Stuart D. Gathman <..!{vrdxhq|daitc}!bms-at!stuart>