questions from using lint

philip at axis.UUCP philip at axis.UUCP
Fri Apr 18 20:42:14 AEST 1986


Just a comment on using lint to improve code portability:

I agree entierely that lint really does cut down on debugging time and
should always be used during development. However, some of my experiences
with portability are not so encouraging.

We sell a Pascal -> C translator (written in C) which we port to (almost)
any UNIX system which has a C compiler. When I took over responsibility
for this product, there was an outstanding job - porting to a RIDGE running
ROS (not a real unix anyway). This had been attempted by my predecessor
and abandoned. When I looked at the problem I didn't blame him - the
translator uses lots of variable argument lists, and the RIDGE has a
wierd method of passing arguments!

To help me to find out where the problems lay, I used lint. It took about
three weeks of work to make the whole think lint-free, but it was worth it,
it worked! (I had to write my own version of varargs).

Now comes the nasty bit: One day I tried to port this to another machine
(which shall remain nameless), and the compiler produced LOTS of messages
about pointer coercions (you guessed it, its one of those machines with
ints and pointers of different sizes). I ran lint and it produced about
5 pages of complaints - not all related to pointers.

It would seem that some people out there MODIFY lint to match their own
compilers. This makes using lint just about worthless when trying to write
portable code. The only consolation is that such a nasty trick seems to
be quite rare.

The moral is BEWARE lint-free one one machine may not be lint free
on another.



More information about the Comp.lang.c mailing list