This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=eeb79a3c306eab5930957c7cc0793926f1d0b77e commit eeb79a3c306eab5930957c7cc0793926f1d0b77e Author: Guillem Jover <[email protected]> AuthorDate: Fri May 22 05:48:51 2020 +0200 test: Update suppressions for cppcheck 2.0 We need to disable some more false positives. And while we should be configuring some -I and -D, we cannot, as cppcheck lack of understanding of non-returning functions makes the subsequent analysis useless. --- debian/changelog | 1 + t/cppcheck.t | 4 ++++ t/cppcheck/cppcheck.supp | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/debian/changelog b/debian/changelog index 1e5491ad0..6b66152e7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -77,6 +77,7 @@ dpkg (1.20.1) UNRELEASED; urgency=medium - Do not use make prerequisites on suffix rule definitions. Closes: #961850 - Add man page number suffixes to the automake SUFFIXES variable. + - Update false positive suppressions for cppcheck 1.20. * Packaging: - Switch to debhelper compatibility level 13. - Remove debian/tmp prefix from manpages debhelper fragment files. diff --git a/t/cppcheck.t b/t/cppcheck.t index 696b6b08c..9e8108aec 100644 --- a/t/cppcheck.t +++ b/t/cppcheck.t @@ -25,6 +25,10 @@ test_needs_srcdir_switch(); plan tests => 1; +# XXX: We should add the following to @cppcheck_opts, but then cppcheck emits +# tons of false positives due to not understanding non-returning functions. +# -DLIBDPKG_VOLATILE_API=1 +# -Ilib my @cppcheck_opts = (qw( -q --force --error-exitcode=2 --suppressions-list=t/cppcheck/cppcheck.supp diff --git a/t/cppcheck/cppcheck.supp b/t/cppcheck/cppcheck.supp index cd5a4db0c..e12c31db7 100644 --- a/t/cppcheck/cppcheck.supp +++ b/t/cppcheck/cppcheck.supp @@ -11,6 +11,8 @@ variableScope // Ignore, this is an imported module. unusedStructMember:lib/compat/obstack.c nullPointerArithmetic:lib/compat/obstack.c +nullPointerRedundantCheck:lib/compat/obstack.c +nullPointerArithmeticRedundantCheck:lib/compat/obstack.c // Ignore, we are testing the functions. knownConditionTrueFalse:lib/dpkg/t/t-macros.c @@ -21,6 +23,12 @@ literalWithCharPtrCompare:lib/dpkg/t/t-test.c // Ignore, the code is used only for its binary artifacts. uninitMemberVar:*/Dpkg_Shlibs/patterns.cpp +// BUG: False positive, it gets triggered even with -Ilib. +unknownMacro + +// BUG: False positive, the function returns a pointer within a local. +returnDanglingLifetime:lib/dpkg/pkg-hash.c + // BUG: False positive, the variable uses operator() which writes to it. constVariable:dselect/pkgsublist.cc:111 @@ -34,6 +42,7 @@ identicalInnerCondition:lib/dpkg/fsys-hash.c:100 unusedStructMember:lib/dpkg/triglib.c:378 // BUG: False positive, does not understand non-returning functors. +nullPointerRedundantCheck:lib/dpkg/ehandle.c nullPointerRedundantCheck:utils/update-alternatives.c:1193 doubleFree:utils/update-alternatives.c:1248 -- Dpkg.Org's dpkg

