Re: [PATCH net v3] tcp: Fix -Wc23-extensions in tcp_options_write()

From: Eric Dumazet
Date: Mon Nov 06 2023 - 22:44:28 EST


On Mon, Nov 6, 2023 at 10:14 PM Nathan Chancellor <nathan@xxxxxxxxxx> wrote:
>
> Clang warns (or errors with CONFIG_WERROR=y) when CONFIG_TCP_AO is set:
>
> net/ipv4/tcp_output.c:663:2: error: label at end of compound statement is a C23 extension [-Werror,-Wc23-extensions]
> 663 | }
> | ^
> 1 error generated.
>
> On earlier releases (such as clang-11, the current minimum supported
> version for building the kernel) that do not support C23, this was a
> hard error unconditionally:
>
>
> Closes: https://github.com/ClangBuiltLinux/linux/issues/1953
> Fixes: 1e03d32bea8e ("net/tcp: Add TCP-AO sign to outgoing packets")
> Signed-off-by: Nathan Chancellor <nathan@xxxxxxxxxx>
> ---
> Changes in v3:
> - Don't use a pointer to a pointer for ptr parameter to avoid the extra
> indirection in process_tcp_ao_options(), just return the modified ptr
> value back to the caller (Eric)

SGTM thanks.
Reviewed-by: Eric Dumazet <edumazet@xxxxxxxxxx>