>
>I'd like to know what people's experiences with PCLint from Gimpel are
>(or any other lint) for both C and C++ code.
PC-lint from Gimpel is simply *awesome*.
>How often does it catch a problem that might have made it out to the
>field?
More often than I'd care to admit.
>How often does it catch a problem that would have cost non trivial
>time to find during testing?
Ditto.
>i.e. does it save time as well as reduce bugs in the final product or
>is it like an insurance policy that costs but is worth having?
As mentioned before, it can save you significant debug time by finding errors before they make it into your test code.
If you have formal code reviews, it can save you a bundle, if you require a clean lint before wasting people's time.
The costs of lint are *insignificant*, even if you derive no benefit other than peace of mind.
>How often do you lint your code - after every new build? - once a
>week? - just before release?
Lint early. Lint often. Lint is your *friend*.
Every time I edit a module, I run a unit lint to find any gross mistakes.
Just before I link test code, I run a cross-module (complete) lint to make sure everything is copacetic.
Before I run a formal build, I run a cross-module lint to make sure keyword expansion in revision control hasn't killed anything (it hasn't yet, but I'm paranoid).
Lint early. Lint often. Lint is your *friend*.
Regards,
-=Dave