Lint recommendations (Is DOS so much better than Unix?)

Charles Weir cweir at richsun.UUCP
Fri Oct 20 06:27:38 AEST 1989


DETECTING BUGS
--------------

There are a number of common bugs which are easy to detect
mechanically.   Some examples which come to mind are:-

1) if (i=0) ...                                  /* = for == */
2) function() { char array[3]; return (array); } /* Invalid pointer
                                                    return */
3) function() { int i; if (i == 3) ... }         /* uninitialised
                                                    variable */

I know of two MSDOS - based lint programs which will find these (and
some 50 or so other) similar issues.   And I was appalled coming to
Unix (SunOs 4, in fact) to find that the standard lint will not do
that.

Does anyone know of Unix programs which will do the same job?

I consider this very important to increase programmer productivity.
And I will summarise any information received to the net.    Look for
"Summary: Lint Recommendations".

(Please don't start an argument about whether (1) is OK or not.   Yes,
I know it's a construction which is frequently used.   The point is
that here it isn't what the programmer intended.   Both the MSDOS lints
allow you to ignore specified types of errors.)


-- 
Charles Weir, Rich Inc, Franklin Park, IL 60131
Email: cweir at richsun.uucp  uunet!richsun!cweir



More information about the Comp.lang.c mailing list