public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH v2 00/28] Fixes for static checkers
@ 2022-09-29  3:38 David Gibson
  2022-09-29  3:38 ` [PATCH v2 01/28] Clean up parsing of port ranges David Gibson
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: David Gibson @ 2022-09-29  3:38 UTC (permalink / raw)
  To: passt-dev

[-- Attachment #1: Type: text/plain, Size: 2840 bytes --]

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).

Changes since v1:
 * Fixed a whitespace error
 * Added extra background information and details to comments and
   commit messages when removing old suppressions
 * Improved conf_runas() rework to give better error messages

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          | 359 +++++++++++++++++++++++-------------------------
 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           |   5 +
 test/Makefile   |   2 +-
 test/nsholder.c |   2 +-
 util.c          |   2 +-
 util.h          |   1 +
 18 files changed, 236 insertions(+), 253 deletions(-)

-- 
2.37.3


^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2022-09-29 23:31 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-29  3:38 [PATCH v2 00/28] Fixes for static checkers David Gibson
2022-09-29  3:38 ` [PATCH v2 01/28] Clean up parsing of port ranges David Gibson
2022-09-29  3:38 ` [PATCH v2 02/28] clang-tidy: Suppress warning about unchecked error in logfn macro David Gibson
2022-09-29  3:38 ` [PATCH v2 03/28] clang-tidy: Fix spurious null pointer warning in pasta_start_ns() David Gibson
2022-09-29  3:38 ` [PATCH v2 04/28] clang-tidy: Remove duplicate #include from icmp.c David Gibson
2022-09-29  3:38 ` [PATCH v2 05/28] Catch failures when installing signal handlers David Gibson
2022-09-29  3:38 ` [PATCH v2 06/28] Pack DHCPv6 "on wire" structures David Gibson
2022-09-29  3:38 ` [PATCH v2 07/28] Clean up parsing in conf_runas() David Gibson
2022-09-29  3:38 ` [PATCH v2 08/28] cppcheck: Reduce scope of some variables David Gibson
2022-09-29  3:38 ` [PATCH v2 09/28] Don't shadow 'i' in conf_ports() David Gibson
2022-09-29  3:38 ` [PATCH v2 10/28] Don't shadow global function names David Gibson
2022-09-29  3:38 ` [PATCH v2 11/28] Stricter checking for nsholder.c David Gibson
2022-09-29  3:38 ` [PATCH v2 12/28] cppcheck: Work around false positive NULL pointer dereference error David Gibson
2022-09-29  3:38 ` [PATCH v2 13/28] cppcheck: Use inline suppression for ffsl() David Gibson
2022-09-29  3:38 ` [PATCH v2 14/28] cppcheck: Use inline suppressions for qrap.c David Gibson
2022-09-29  3:38 ` [PATCH v2 15/28] cppcheck: Use inline suppression for strtok() in conf.c David Gibson
2022-09-29  3:38 ` [PATCH v2 16/28] Avoid ugly 'end' members in netlink structures David Gibson
2022-09-29  3:38 ` [PATCH v2 17/28] cppcheck: Broaden suppression for unused struct members David Gibson
2022-09-29  3:38 ` [PATCH v2 18/28] cppcheck: Remove localtime suppression for pcap.c David Gibson
2022-09-29  3:38 ` [PATCH v2 19/28] qrap: Handle case of PATH environment variable being unset David Gibson
2022-09-29  3:38 ` [PATCH v2 20/28] cppcheck: Suppress same-value-in-ternary branches warning David Gibson
2022-09-29  3:38 ` [PATCH v2 21/28] cppcheck: Suppress NULL pointer warning in tcp_sock_consume() David Gibson
2022-09-29  3:38 ` [PATCH v2 22/28] Regenerate seccomp.h if seccomp.sh changes David Gibson
2022-09-29  3:38 ` [PATCH v2 23/28] cppcheck: Avoid errors due to zeroes in bitwise ORs David Gibson
2022-09-29  3:38 ` [PATCH v2 24/28] cppcheck: Remove unused knownConditionTrueFalse suppression David Gibson
2022-09-29  3:38 ` [PATCH v2 25/28] cppcheck: Remove unused objectIndex suppressions David Gibson
2022-09-29  3:38 ` [PATCH v2 26/28] cppcheck: Remove unused va_list_usedBeforeStarted suppression David Gibson
2022-09-29  3:38 ` [PATCH v2 27/28] Mark unused functions for cppcheck David Gibson
2022-09-29  3:38 ` [PATCH v2 28/28] cppcheck: Remove unused unmatchedSuppression suppressions David Gibson
2022-09-29 23:31 ` [PATCH v2 00/28] Fixes for static checkers Stefano Brivio

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).