public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
From: Laurent Vivier <lvivier@redhat.com>
To: Anshu Kumari <anskuma@redhat.com>,
	passt-dev@passt.top, sbrivio@redhat.com
Cc: david@gibson.dropbear.id.au, jmaloy@redhat.com,
	Jeskynar <jeskynar@gmail.com>
Subject: Re: [PATCH] ip: Wrap CASE macro body in braces for pre-C23 compatibility
Date: Tue, 19 May 2026 09:06:18 +0200	[thread overview]
Message-ID: <87c720d8-153f-4230-af68-e0b26041791b@redhat.com> (raw)
In-Reply-To: <20260518135806.429955-1-anskuma@redhat.com>

On 5/18/26 15:58, Anshu Kumari wrote:
> From: Jeskynar <jeskynar@gmail.com>
> 
> Compiling on RHEL8 (gcc-8.5) gives an error in ip.c.
> ip.c:88:3: error: a label can only be part of a statement and
> a declaration is not a statement due to the use of static_assert.
> 
> The fix is to surround it with {}.
> 
> Link: https://bugs.passt.top/show_bug.cgi?id=201
> Signed-off-by: Anshu Kumari <anskuma@redhat.com>

Fixes: 93c3e351f235 ("ip: Define a bound for the string returned by ipproto_name()")

Reviewed-by: Laurent Vivier <lvivier@redhat.com>

> ---
>   ip.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/ip.c b/ip.c
> index f2506bb..7b674e0 100644
> --- a/ip.c
> +++ b/ip.c
> @@ -35,9 +35,9 @@ const char *ipproto_name(uint8_t proto)
>   {
>   	switch (proto) {
>   #define CASE(s)								\
> -		static_assert(sizeof(s) <= IPPROTO_STRLEN,		\
> -			      "Increase IPPROTO_STRLEN to contain " #s); \
> -		return s;
> +		{static_assert(sizeof(s) <= IPPROTO_STRLEN,		\
> +			       "Increase IPPROTO_STRLEN to contain " #s); \
> +		return s;}
>   	case IPPROTO_ICMP:
>   		CASE("ICMP");
>   	case IPPROTO_TCP:


      parent reply	other threads:[~2026-05-19  7:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-18 13:58 Anshu Kumari
2026-05-19  1:57 ` David Gibson
2026-05-19  7:06 ` Laurent Vivier [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=87c720d8-153f-4230-af68-e0b26041791b@redhat.com \
    --to=lvivier@redhat.com \
    --cc=anskuma@redhat.com \
    --cc=david@gibson.dropbear.id.au \
    --cc=jeskynar@gmail.com \
    --cc=jmaloy@redhat.com \
    --cc=passt-dev@passt.top \
    --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).