Tuesday, November 29, 2011

Coverity errorformat?

I use Coverity at work (http://www.coverity.com, the same company
whose flagship product has been used on a large number of open-source
projects over the past few years, including Vim: http://scan.coverity.com/),
and recently found out about the cov-format-errors command. Normally
Coverity finds a bunch of potential defects which are then committed
to a central server where all users can view them. The cov-format-
errors command allows you to export all the defects found in a given
analysis into a gcc-like format.

But it's not gcc-like enough for Vim! I'm wondering if anyone has a
compiler plugin/errorformat definition they've found or made for the
cov-format-errors command? Here's a small sample of the output, from
analyzing a portion of some version of the GLU library we link into
our software:

Error: MISSING_RETURN:
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
sweep.c:256:
missing_return: Arriving at the end of a function without returning a
value.
Error: RESOURCE_LEAK:
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
mesh.c:282:
alloc_fn: Calling allocation function "allocFace".
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
mesh.c:58:
alloc_fn: Storage is returned from allocation function "malloc".
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
mesh.c:58:
return_alloc_fn: Directly returning storage allocated by "malloc".
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
mesh.c:282:
var_assign: Assigning: "newFace" = storage returned from
"allocFace()".
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
mesh.c:294:
leaked_storage: Variable "newFace" going out of scope leaks the
storage it points to.
Error: USE_AFTER_FREE:
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
dict.c:72:
alias: Assigning: "node" = "dict->head.next". Now both point to the
same storage.
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
dict.c:73:
freed_arg: "free" frees "node".
/accts/btfritz/coverity/derived_models/glu/Mesa3-5/si-glu/libtess/
dict.c:72:
deref_after_free: Dereferencing freed pointer "node".

Later this week if nobody knows of a ready-made solution, I'll
probably piece together an errorformat string on my own. But I figure
I'll save the effort if somebody already has it done for me.

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments:

Post a Comment