Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!brl-tgr!gwyn From: gwyn@brl-tgr.ARPA (Doug Gwyn ) Newsgroups: net.lang.c Subject: Re: Why does S5 lint dislike all casts to long? Message-ID: <5941@brl-tgr.ARPA> Date: Tue, 20-Nov-84 12:25:36 EST Article-I.D.: brl-tgr.5941 Posted: Tue Nov 20 12:25:36 1984 Date-Received: Thu, 22-Nov-84 05:47:59 EST References: <224@desint.UUCP> Organization: Ballistic Research Lab Lines: 24 I think Geoff's "lint" has several more bugs than the current version. The ONLY spurious "lint" messages I get are due to its lack of understanding of semantics: - exit( retval ); does not return; /*NOTREACHED*/ helps but the main() routine is still expected to return an int value even though all termination is via exit(). - the (char *) returned by malloc() is guaranteed to be properly aligned so that coercion to any other pointer type will work properly. Since "lint" doesn't know about this property, it warns about incompatible pointer types when it sees the coercion. A similar problem occurs when casting back to a (char *) for free(). I maintain thousands of lines of source code that pass through "lint" (SVR2) with absolutely no warning or error messages other than those noted above. I find "lint" to be very valuable in reducing bugs and detecting module design flaws (unused parameters, etc.). I note that much of the AT&T UNIX user-mode source code has had bugs that have shown up under "lint".