views:

181

answers:

3

What are 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.

+2  A: 

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.

Anders K.
I emailed them and they said that they are working on an Eclipse plug-in
Mawg
+1  A: 

Well I don't know of free/opensource tools designed to process pc-lint output, but I have used the following strategy using splint

  1. 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
  2. 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.
hhafez
A: 

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.

Clifford