On Mon, May 18, 2026 at 07:28:06PM +0530, Anshu Kumari wrote: > From: Jeskynar > > 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 Reviewed-by: David Gibson > --- > 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: > -- > 2.54.0 > -- 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