Yet Another Lint Foul-up

Jim Shankland jas at ernie.Berkeley.EDU
Sat Jan 7 03:52:52 AEST 1989


In article <1298 at tank.uchicago.edu> vevea at paideia.UUCP (Jack L. Vevea) asks
(paraphrased), why people make a fuss about lint messages that they
know to be inconsequential -- is it that a higher authority requires
that their code be lint-free, or are they just being obsessive "slaves
to lint?"

Sometimes, a higher authority does require lint-free code.  This is not
a bad thing, even if you do have to do some pretty strange things
(e.g., using "#ifdef lint") to make it happen.  Even when there is no
such higher authority, it's a good idea to arrange for code to be
completely lint-free.  While I *know* that "possible pointer alignment
problem" on return from malloc() is inconsequential, other, even
more highly paid software engineers :-) "know" that all kinds of other
lint messages are inconsequential, because the code works fine on their
VAX.  This is a sad fact; very sad, but very much a fact.

Second, if my code generates n inconsequential lint messages, then every
time I re-lint the code, I have to pick out the "real" lint, if any,
from the n inconsequential messages.  This is burdensome and error-prone.
Better to habitually use a few contrivances that eliminate the harmless
lint messages.

(Of course, the above-mentioned software engineers may then put all sorts
of unsafe weirdness into their code "to shut lint up".  Ultimately,
this is a major problem with C:  it's too easy to write non-portable code,
and too hard to specify the rules for writing portable code.  No, I'm
not proposing a solution, and I'm certainly not saying we should all
be programming in Pascal -- just pointing out a *very* costly problem
with the language.  If you doubt me, consider this small example:
what percentage of C programmers do you think know what the correct
definition of NULL is, and when NULL needs to be preceded by a type cast,
despite regular clarifications of the question in comp.lang.c?  No
fair counting those who "know" an answer that is wrong!)

Jim Shankland
jas at ernie.berkeley.edu



More information about the Comp.lang.c mailing list