[PATCH] secprof: Add a statement after labels at end of a block

Jouni Malinen j at w1.fi
Sat Oct 24 07:22:16 PDT 2026


On Thu, Oct 08, 2026 at 02:55:48PM +0300, Andrei Otcheretianski wrote:
> A label must be followed by a statement in C17 and older; C23 lifted
> that requirement. GCC accepts the construct as an extension, but a
> compiler that enforces the constraint rejects it with "label at end of
> compound statement" and the build fails.

Which compiler and version are you thinking of here and is this label at
the end of a block really the only issue with it? As an example, clang
18.1.3 with -Wc23-extensions will identify quite a few other
issues, e.g., due to empty initializers..

> Add an empty statement after the no_room, no_sp_match and no_valid_sp
> labels.

That looks ugly.. Couldn't the label simply be moved to be after the
block?

> diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c
> @@ -7636,6 +7636,7 @@ rsnxe_done:
>  		if (hapd->conf->security_profiles)
>  			p = hostapd_eid_security_profile(hapd, p);
>  	no_room:
> +		;
>  	}

I.e., instead of that, move no_room: to be after that }..

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list