Does anyone have good tips for using pc-lint?
What 开发者_如何学Goare some best practices for using pc-lint - how to wade thru the zillion options?
I'm particularly interested in better ways to read/parse the output files.
There's a Visual Lint that builds upon PC-Lint making the messages a bit more friendly. Unfortunately its not free and only works on Windows with Visual Studio. They have a trial version IIRC.
See
Since my employer at the time was a cheapskate I didn't get the full version, although I did find it useful.
The ALOA project offers free code to parse PC-Lint output and run regression analysis on repeated runs.
There's a nice little article How to wield PC Lint that I recommend.
The Riverblade people who publish Visual Lint published a couple of articles on config:
- Taming the Lint Monster pt1
- Taming the Lint Monster pt2
Well I don't know of free/opensource tools designed to process pc-lint output, but I have used the following strategy using splint
- To decide on which options to turn on: We looked at the defects we have had and seen which could have been detected by splint. Really it was a matter of going through the splint options and deciding weather it is something that if left undedected has or will cause a problem for us
- Regarding process the output, we developed some awk scripts that would give a summary of warning, and details where each warning occurred instead of having it intertwined with the compiler output. There was also an option to only report warnings on new/modifed code.
The "Indian Hill C Style and Coding Standards" talks about approaches to using Lint.
My approach to any static analysis tool is to define your local coding standard (or use an existing one), then apply the static analysis rules that enforce that standard. Explicitly switch off the rules for code that you allow, and leave on the rules for all those aspects your standard never even considered; when they occur, consider whether your coding standard needs modification or if the rule should be switched off, or whether it was simply a coding error that should be fixed without change to either the standard or the analyser configuration.
精彩评论