smatch output

Artem Bityutskiy dedekind1 at gmail.com
Tue Feb 4 01:59:14 EST 2014


Hi Dan,

we use smatch in the Aiaiai project. Just to remind, what we do is:

1. Build the kernel with smatch (and other checkers too) before applying
the "patch-set under test". Collect full log, let's call it "log1".

2. Apply the patch-set under test and do the same, collect full log
again, let's call it "log2".

Then we compare log2 and log2, and trying to show users only _new_
gcc/smatch/spatch/coccinelle/cppcheck warnings.

log1 and log2 may have different line numbers, and we are able to take
this into account when the format of the warning is like this:

path/to/the/file.c:XXX: blah blah (line YYY) blah blah

I.e., we look for the "^path:XXX:" and "line YYY" patterns. And we can
then look to the patch, and change XXX and YYY accordingly.

Then if the warning is in both log1 and log2, we won't tell about it.
Otherwise, we will complain.

Also, all the lines starting with the same file prefix and line number
are treated as one single block, i.e., one warning.

This worked for smatch in the past quite well. But recently I started
seeing that smatch may output multi-line warnings. E.g., take a look at
Aiaiai output here:

https://review.tizen.org/gerrit/#/c/15980/

(this is gerrit for the Tizen IVI kernel, check message from Aiaiai" in
the comments section).

I also saw warnings which were something like contained a long list of
line numbers. That was something like listing lines containing some
locks. I do not remember for sure.

Could we please try to somehow formalize smatch output so that Aiaiai
could predictably process it?

For the multi-line output, is it possible to prefix it with the same
prefix so that Aiaiai would understand that this is one single block of
output?

When you have to print many lines, can we agree on the format? Probably
something like "lines X,Y,Z", etc. Then I could modify our tool to
process this.

Thanks!

-- 
Best Regards,
Artem Bityutskiy




More information about the aiaiai mailing list