public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: Peter Foley <pefoley@google.com>, passt-dev@passt.top
Subject: Re: [PATCH] Avoid clang warnings in fwd.h
Date: Mon, 2 Mar 2026 15:34:52 +1100	[thread overview]
Message-ID: <aaUTbNd_KNrVuS_H@zatzit> (raw)
In-Reply-To: <20260224095055.4c3be413@elisabeth>

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

On Tue, Feb 24, 2026 at 09:50:56AM +0100, Stefano Brivio wrote:
> On Tue, 24 Feb 2026 16:48:14 +1100
> David Gibson <david@gibson.dropbear.id.au> wrote:
> 
> > On Mon, Feb 23, 2026 at 12:29:20PM -0500, Peter Foley wrote:
> > > e.g.
> > > ./fwd.h:65:63: warning: '_Static_assert' with no message is a C23 extension [-Wc23-extensions]
> > >    65 | static_assert(sizeof(union fwd_listen_ref) == sizeof(uint32_t));
> > > 
> > > Signed-off-by: Peter Foley <pefoley@google.com>
> > > ---
> > >  fwd.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/fwd.h b/fwd.h
> > > index 1607011..7d299b6 100644
> > > --- a/fwd.h
> > > +++ b/fwd.h
> > > @@ -62,7 +62,7 @@ union fwd_listen_ref {
> > >  	};
> > >  	uint32_t u32;
> > >  };
> > > -static_assert(sizeof(union fwd_listen_ref) == sizeof(uint32_t));
> > > +static_assert(sizeof(union fwd_listen_ref) == sizeof(uint32_t), "");  
> > 
> > I'd prefer to see an actual message added here, rather than just
> > minimally suppressing the warning.
> 
> Can you please suggest a message then? You added this static_assert()
> in the first place.

Fair point.

I looked into this, and realised that I can make another cleanup in
the vicinity which changes the union into a struct and makes this
static_assert() redundant amongst some other improvements.  Patch on
the list.

-- 
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:[~2026-03-02  4:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23 17:29 Peter Foley
2026-02-24  5:48 ` David Gibson
2026-02-24  8:50   ` Stefano Brivio
2026-03-02  4:34     ` David Gibson [this message]
2026-03-03 19:11 ` Stefano Brivio
2026-03-04 19:14   ` Peter Foley

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=aaUTbNd_KNrVuS_H@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=passt-dev@passt.top \
    --cc=pefoley@google.com \
    --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).