Cppcheck: Reduction of False Positives: Manual Approach

Tamás Zolnai zolnaitamas2000 at gmail.com
Tue Oct 2 08:01:08 UTC 2018


Hi Luke,

slacka <lukebenes at hotmail.com> ezt írta (időpont: 2018. okt. 2., K, 4:05):

> The goal of my manual approach was to configure Cppcheck to minimize false
> positives. In doing so, I was forced to only scan the Linux code base, as
> only Linux has Linux system headers and does not have Window's or BSD's...
> So I am not surprised that some valid issues were not reported.
>
> There are many knobs I could tweak. For example, since my last post, I
> discovered I could remove the "-DNDEBUG" to scan the debug code path. I
> could also remove the "-j 4" option to allow Cppcheck to scan for unused
> functions.  I don't know what is most useful, and what valid issues were
> not
> being reported.  This is why I have asked the ML for feedback.
>

I used to find valid issues amongs the variableScope warnings for example.
Check a frequently modified module (e.g. sw, sc, sd).
One example:
https://dev-builds.libreoffice.org/cppcheck_reports/master/1501.html#line-1729
I just checked a few of these warnings now and they should be there in a
Linux specific analysis too. The linked one seems not a platform specific
or debug code. So it would be good to find out why your report does not
contains this one.

In general I doubt that a static analyzer does not find any issue (at least
some false positives) in sw module for example (if it was not cleaned up
with this analyzer earlier). You report contains no issue in sw. It seems
to me the scope of the analysis is greatly reduced by your change, that's
why it does not find a lot of issues. I'm not sure how the false positives
can be reduced by specifing the includes. Which false positives are coming
from wrong includes?

Best Regards,
Tamás
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20181002/7e38029c/attachment.html>


More information about the LibreOffice mailing list