public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Stefano Brivio <sbrivio@redhat.com>
To: David Gibson <david@gibson.dropbear.id.au>
Cc: Peter Foley <pefoley@google.com>, passt-dev@passt.top
Subject: Re: [PATCH] Add missing includes to headers
Date: Tue, 24 Feb 2026 10:32:54 +0100 (CET)	[thread overview]
Message-ID: <20260224103253.3a633773@elisabeth> (raw)
In-Reply-To: <aZ06cUSkuTnY_MSp@zatzit>

On Tue, 24 Feb 2026 16:43:13 +1100
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Mon, Feb 23, 2026 at 01:08:07PM -0500, Peter Foley wrote:
> > On Mon, Feb 23, 2026 at 12:35 PM Stefano Brivio <sbrivio@redhat.com> wrote:
> >   
> > > By the way, we already run clang-tidy tests ('make clang-tidy') as part
> > > of our tests (test/build/static_checkers.sh).
> > >
> > > Would it be just a matter of enabling the misc-include-cleaner in the
> > > list of tests we give clang-tidy from the Makefile:
> > >
> > >   https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html
> > >
> > > ? I haven't tried.
> > >  
> > 
> > It appears so, a local change to pass -checks=misc-include-cleaner to
> > clang-tidy resulted in a ton of errors like:
> > /usr/local/google/home/pefoley/passt/vu_common.c:277:2: error: no header
> > providing "iov_from_buf" is directly included
> > [misc-include-cleaner,-warnings-as-errors]
> >   277 |         iov_from_buf(in_sg, elem_cnt, VNET_HLEN, buf, total);
> >       |         ^
> > /usr/local/google/home/pefoley/passt/vu_common.c:301:15: error: no header
> > providing "ETH_ZLEN" is directly included
> > [misc-include-cleaner,-warnings-as-errors]
> >     9 |         if (l2len >= ETH_ZLEN)
> >       |                      ^
> > /usr/local/google/home/pefoley/passt/vu_common.c:304:2: error: no header
> > providing "memset" is directly included
> > [misc-include-cleaner,-warnings-as-errors]
> >     9 |         memset((char *)iov->iov_base + iov->iov_len, 0, ETH_ZLEN -
> > l2len);  
> 
> Unfortunately, I suspect this isn't going to work out.  It may do some
> of the checks we want here, but unfortunately it makes some very silly
> warnings in relation to the standard library, which is why we disabled
> it in the first place.  See commit
> 3be9e0010ea7329ae0f3707f67ac4cf0bac13d54

Ouch, right, I had forgotten about that.

> I guess we should retry and see if the latest LLVM is better about
> this, though.

I guess:

  https://github.com/pefoley2/passt/commit/6ae0bcb2bbdc10384346dda547db60f80c8a9676

makes that mostly pass with a recent LLVM version? If we need a dozen
of suppressions (maybe even 20-30?) I would say it's sustainable, but
more than that and it will start looking messy.

-- 
Stefano


  reply	other threads:[~2026-02-24  9:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 17:45 Peter Foley
2026-02-21 17:57 ` Stefano Brivio
     [not found]   ` <CAAAKUPN=GPDp84tQAv4Kpxs-AzKR44pDkWda-AbXWaUomYN5eg@mail.gmail.com>
     [not found]     ` <CAAAKUPMP8goRHqk0VDn6UDWmyyPXpzs37UuCLL8x7wDp10tY6A@mail.gmail.com>
2026-02-23 17:35       ` Stefano Brivio
     [not found]         ` <CAAAKUPMQZetb9RYoxaUZGyp7dWm8pifmvEfyV3M4Q6+j9jw89g@mail.gmail.com>
2026-02-23 18:11           ` [PATCH v2] " Peter Foley
2026-02-23 19:05           ` [PATCH] " Stefano Brivio
     [not found]             ` <CAAAKUPMRYcbeTXZHX9aQtZfv4L=sBbzqSWqo-xG91F6r7f8M1w@mail.gmail.com>
2026-02-23 20:47               ` Stefano Brivio
     [not found]                 ` <CAAAKUPPS8_7gJ1T677djyWJ8WbKSoijKsuM8J1cgLLD5HDPXgw@mail.gmail.com>
2026-02-23 23:00                   ` Stefano Brivio
2026-02-24  5:43           ` David Gibson
2026-02-24  9:32             ` Stefano Brivio [this message]
     [not found]               ` <CAAAKUPMWQ2t5zT5-rZjvFDaEOSiA44mW9md25i58SDhE=YOMxA@mail.gmail.com>
2026-02-24 17:53                 ` Stefano Brivio
     [not found]                   ` <CAAAKUPOJhP2OvEyh6BJq8OUviv3UC-ev5ybvqprYkEVif1Carg@mail.gmail.com>
2026-02-24 20:03                     ` Stefano Brivio
     [not found]                       ` <CAAAKUPM6j6paYFMJgNpzj7RbsAzradSjpb166_epih9DN=3CnA@mail.gmail.com>
2026-02-24 21:18                         ` Stefano Brivio
     [not found]                           ` <CAAAKUPNo7z-jbFKTcMdTeVyAKz7nfwQm2sMeY30xU7KRJO5vuw@mail.gmail.com>
2026-02-24 22:49                             ` Stefano Brivio
2026-02-25 23:23                       ` David Gibson
2026-02-23  5:33 ` David Gibson
2026-02-23 16:32   ` Stefano Brivio
2026-02-24  5:37     ` 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=20260224103253.3a633773@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=pefoley@google.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).