public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Laurent Vivier <lvivier@redhat.com>
Cc: passt-dev@passt.top
Subject: Re: [PATCH] tcp: Suppress false positive cppcheck warning in tcp_update_seqack_wnd()
Date: Wed, 10 Dec 2025 09:55:40 +1100	[thread overview]
Message-ID: <aTio7Lwcxz1B-8I1@zatzit> (raw)
In-Reply-To: <20251209134904.3237912-1-lvivier@redhat.com>

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

On Tue, Dec 09, 2025 at 02:49:04PM +0100, Laurent Vivier wrote:
> Cppcheck doesn't track that tinfo is reassigned to &tinfo_new when NULL,
> leading to a false uninitvar warning at line 1099. Add inline
> suppression.

I think this is the same cppcheck bug as I encountered, a dozen or so
lines below this.  See
	https://sourceforge.net/p/cppcheck/discussion/general/thread/fecde59085/
and/or
	https://trac.cppcheck.net/ticket/14191

> 
> Signed-off-by: Laurent Vivier <lvivier@redhat.com>
> ---
>  tcp.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tcp.c b/tcp.c
> index 17fda5dcd7db..8dabfd3042d2 100644
> --- a/tcp.c
> +++ b/tcp.c
> @@ -1132,6 +1132,7 @@ int tcp_update_seqack_wnd(const struct ctx *c, struct tcp_tap_conn *conn,
>  				return 0;
>  		}
>  
> +		/* cppcheck-suppress uninitvar */

Like the other case, I think we'll need unmatchedSuppression here, or
we'll get the unmatched suppression warning once using a fixed version
of cppcheck.  Possibly also with earlier cppcheck versions that didn't
trip on this.

>  		if ((unsigned)SNDBUF_GET(conn) > (long long)tinfo->tcpi_rtt *
>  						 tinfo->tcpi_delivery_rate /
>  						 1000 / 1000 *
> -- 
> 2.51.1
> 

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      reply	other threads:[~2025-12-09 22:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-09 13:49 Laurent Vivier
2025-12-09 22:55 ` David Gibson [this message]

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=aTio7Lwcxz1B-8I1@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=lvivier@redhat.com \
    --cc=passt-dev@passt.top \
    /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).