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: passt-dev@passt.top
Subject: Re: [PATCH] pif: Add message to static_assert for C11 compliance, fix build with gcc 8
Date: Sun, 19 Jul 2026 19:49:47 +0200 (CEST)	[thread overview]
Message-ID: <20260719194947.5baacb55@elisabeth> (raw)
In-Reply-To: <alxNBm_Wj8wjFuHP@gractus.seuss>

On Sun, 19 Jul 2026 14:05:27 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> On Sat, Jul 18, 2026 at 09:41:34AM +0200, Stefano Brivio wrote:
> > Seen with gcc 8.5:
> > 
> > ---
> > In file included from passt.h:18,
> >                  from qrap.c:36:
> > pif.h: In function 'pif_type':
> > pif.h:48:44: error: expected ',' before ')' token
> >   static_assert(sizeof("?") <= PIF_NAME_SIZE);
> >                                             ^
> > make: *** [Makefile:105: qrap] Error 1
> > ---
> > 
> > As noted in ba84a3b17af8 ("treewide: Add messages to static_assert()
> > calls"), static_assert() calls need a message to comply with C11. The
> > form without message is supported starting from C23 only.
> > 
> > Fixes: cbcd4284111f ("pif: Limit pif names to 128 bytes")
> > Signed-off-by: Stefano Brivio <sbrivio@redhat.com>  
> 
> Huh.  Weird I didn't get a warning for this one, I've caught this same
> mistake a bunch of times before because of a warning, though I forget
> if it came from the compiler or one of the static checkers.

Same here, I didn't get a warning either, but in ba84a3b17af8 you
mentioned clang-tidy reporting warnings only in some cases, so I guess
that's the kind of warning you would have expected.

-- 
Stefano


      reply	other threads:[~2026-07-19 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-18  7:41 Stefano Brivio
2026-07-19  4:05 ` David Gibson
2026-07-19 17:49   ` Stefano Brivio [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=20260719194947.5baacb55@elisabeth \
    --to=sbrivio@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --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).