From ee9b2361d04027669bff8df4dc10722bda1c1333 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Thu, 2 Oct 2025 15:04:34 +1000 Subject: cppcheck: Suppress a buggy cppcheck warning 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 Signed-off-by: Stefano Brivio --- tcp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tcp.c b/tcp.c index 48b1ef2..7da4179 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; -- cgit v1.2.3