From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: [PATCH 00/28] Fixes for static checkers Date: Wed, 28 Sep 2022 14:33:11 +1000 Message-ID: <20220928043339.613538-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0563213838952718639==" --===============0563213838952718639== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit The passt tests include two static checking tools: clang-tidy and cppcheck. However, newer versions of those tools have introduced extra checks, and may cause these tests to fail. This series fixes all the clang-tidy and cppcheck warnings, either by altering our code, or by suppressing them with relevant options to the checkers. With this series, the checks are now clean on both my Fedora 36 machine (clang-tools-extra-14.0.5-1.fc36.x86_64 and cppcheck-2.7.4-2.fc36.x86_64) and my Debian machine (bookworm with some pieces from sid: clang-tidy 1:14.0-55.1 and cppcheck 2.9-1). David Gibson (28): Clean up parsing of port ranges clang-tidy: Suppress warning about unchecked error in logfn macro clang-tidy: Fix spurious null pointer warning in pasta_start_ns() clang-tidy: Remove duplicate #include from icmp.c Catch failures when installing signal handlers Pack DHCPv6 "on wire" structures Clean up parsing in conf_runas() cppcheck: Reduce scope of some variables Don't shadow 'i' in conf_ports() Don't shadow global function names Stricter checking for nsholder.c cppcheck: Work around false positive NULL pointer dereference error cppcheck: Use inline suppression for ffsl() cppcheck: Use inline suppressions for qrap.c cppcheck: Use inline suppression for strtok() in conf.c Avoid ugly 'end' members in netlink structures cppcheck: Broaden suppression for unused struct members cppcheck: Remove localtime suppression for pcap.c qrap: Handle case of PATH environment variable being unset cppcheck: Suppress same-value-in-ternary branches warning cppcheck: Suppress NULL pointer warning in tcp_sock_consume() Regenerate seccomp.h if seccomp.sh changes cppcheck: Avoid errors due to zeroes in bitwise ORs cppcheck: Remove unused knownConditionTrueFalse suppression cppcheck: Remove unused objectIndex suppressions cppcheck: Remove unused va_list_usedBeforeStarted suppression Mark unused functions for cppcheck cppcheck: Remove unused unmatchedSuppression suppressions Makefile | 26 +--- arch.c | 4 +- conf.c | 344 ++++++++++++++++++++++-------------------------- dhcpv6.c | 26 ++-- icmp.c | 1 - igmp.c | 1 + netlink.c | 22 ++-- passt.c | 7 +- pasta.c | 5 +- qrap.c | 18 ++- seccomp.sh | 2 + siphash.c | 1 + tap.c | 5 +- tcp.c | 2 + test/Makefile | 2 +- test/nsholder.c | 2 +- util.c | 2 +- util.h | 1 + 18 files changed, 222 insertions(+), 249 deletions(-) -- 2.37.3 --===============0563213838952718639==--