clion-cppcheck icon indicating copy to clipboard operation
clion-cppcheck copied to clipboard

display `unmatchedSuppression` findings

Open firewave opened this issue 3 years ago • 2 comments

We currently suppress unmatchedSuppression findings unconditionally but this is actually something interesting as it will indicate no longer applying (inline) suppressions.

firewave avatar Jul 25 '22 19:07 firewave

I did not consider unmatchedSuppression important previously since it requires information to be enabled. It has also various bugs which might lead to false positives. It is currently not even enabled in the selfcheck in the Cppcheck CI (which is actually quite bad since we won't be informed about obsolete suppressions i.e. fixed false positives).

While bisecting issues in Cppcheck I needed these messages several times and had to run it on the command-line instead.

firewave avatar Jul 25 '22 19:07 firewave

After enabling it again I realized why I did omit it.

You might get a unmatchedSuppression without a location from global suppressions which are specified via --suppress or in a suppression file which do not have a location.

Since the Cppcheck configuration is global for all projects that is not something you want to see. So we simply need to ignore these findings without a location so we will still get the ones for unmatched inline suppressions.

We should also enable --inline-suppr by default but I will do that in another ticket.

firewave avatar Aug 14 '22 13:08 firewave