--- In [email protected], Mickey Mathieson <[EMAIL PROTECTED]> wrote:
>
> Has anyone used Pc-Lint by Gimpel?
Yes- and FlexeLint, which is the Unix/Linux version.
> Do you recommend it?
Absolutely. When you run it on code that hasn't been linted before,
the sheer quantity of the output can be daunting. But with experience
it isn't too difficult to write a lint configuration file that picks
out the warnings that are more likely to indicate 'real' bugs. It's
then up to you whether you attempt to actually modify the code to
improve it and reduce the number of warnings and potential
bugs/maintenance issues.
Of course it's best to use lint as you are writing the code in the
first place.
> Any other thoughts would be help full.
Lint doesn't force you to write code a certain way. For example, as
you would expect, it issues a warning if it comes across something like:
if (x = y)
Info 720: Boolean test of assignment
That is, did the author mean assignment (=) or did they actually mean
to test for equality (==), which would be more logical (but
syntactically equally valid)?
But if you did mean assignment, you can disable the warning just on
that line of code:
if (x = y) /*lint !e720 */
This makes the code self documenting (you can add text after the 720
within the comment if you want to make it clearer).
There are other options to disable warnings within a region of code,
or file, or the whole project if you have a project policy of allowing
this construct.
It's this configurability(?) which I believe makes PC/Flexe-lint so
powerful.
PC-lint can issue a vast number of warnings - I know compilers have
improved and issue more warnings than they used to, but they can't
touch lint. See http://www.gimpel-online.com/MsgRef.html
I've helped implement PC/Flexe-lint based procedures at all 3
companies I've worked at. However, even if your company doesn't want
to pay for it, I would buy a copy yourself and see your code quality
improve (although I'm sure it's already excellent :-). The PC version
is quite cheap, and can be used under Wine in Linux instead of buying
a relatively expensive Flexelint license (this is legal BTW).
In case you hadn't noticed, I'm a fan :-)
John
http://www.picochip.com/