Strange lint mumblings

David F. Carlson dave at micropen
Wed Dec 28 07:25:35 AEST 1988


In article <782 at auspex.UUCP>, guy at auspex.UUCP (Guy Harris) writes:
> >How about:
> >
> >	void main ()
> 	...
> 
> Doesn't help (I tried it), and isn't correct anyway.  The dpANS
> indicates, as I remember, that "main" is expected (at least in a hosted
> environment) to return an "int", and that if "main" returns "exit" is
> then called with its return value as an argument.

int main()	{
 ....
 if (blah) exit(-1);

 ...
 return( 0 );
}

I have solved this "problem" by not using the function exit() to return
to the calling environment main() status.  Rather, use return at the end
of main().  Lint seems to like return from functions.  It never has been
able to deal with exit() properly, ("statement not reached", etc.) so why 
try?


-- 
David F. Carlson, Micropen, Inc.
micropen!dave at ee.rochester.edu

"The faster I go, the behinder I get." --Lewis Carroll



More information about the Comp.lang.c mailing list