Strange lint mumblings

Stuart Gathman stuart at bms-at.UUCP
Tue Dec 20 06:16:57 AEST 1988


In article <416 at marob.MASA.COM>, daveh at 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	<stuart at bms-at.uucp>
			<..!{vrdxhq|daitc}!bms-at!stuart>



More information about the Comp.lang.c mailing list