From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>, passt-dev@passt.top
Cc: David Gibson <david@gibson.dropbear.id.au>
Subject: [PATCH v3 3/6] cppcheck: Suppress a buggy cppcheck warning
Date: Thu, 2 Oct 2025 15:04:34 +1000 [thread overview]
Message-ID: <20251002050437.4175553-4-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <20251002050437.4175553-1-david@gibson.dropbear.id.au>
Another cppcheck package in Fedora, another bogus false positive. This
one seems to not realise that a variable has been initialised by
getsockopt() under a complicated set of circumstances.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
tcp.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tcp.c b/tcp.c
index 48b1ef29..7da41797 100644
--- a/tcp.c
+++ b/tcp.c
@@ -1030,6 +1030,11 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn,
return 0;
}
+ /* This trips a cppcheck bug in some versions, including
+ * cppcheck 2.18.3.
+ * https://sourceforge.net/p/cppcheck/discussion/general/thread/fecde59085/
+ */
+ /* cppcheck-suppress [uninitvar,unmatchedSuppression] */
conn->seq_ack_to_tap = tinfo->tcpi_bytes_acked +
conn->seq_init_from_tap;
--
2.51.0
next prev parent reply other threads:[~2025-10-02 5:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-02 5:04 [PATCH v3 0/6] Test and linter fixups David Gibson
2025-10-02 5:04 ` [PATCH v3 1/6] clang-tidy: Suppress redundant expression warning David Gibson
2025-10-02 5:04 ` [PATCH v3 2/6] cppcheck: Suppress the suppression of a suppression David Gibson
2025-10-02 5:04 ` David Gibson [this message]
2025-10-02 5:04 ` [PATCH v3 4/6] cppcheck: Suppress variable scope warnings in dhcpv6() David Gibson
2025-10-02 5:04 ` [PATCH v3 5/6] test: Don't delete exetool on make clean David Gibson
2025-10-02 5:04 ` [PATCH v3 6/6] test: Add linting of Python test scripts David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251002050437.4175553-4-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).