Re: [PATCH] netfilter: ebtables: replace zero-length array members

From: Phil Sutter
Date: Wed Aug 09 2023 - 07:03:58 EST


On Wed, Aug 09, 2023 at 03:51:36PM +0800, GONG, Ruiqi wrote:
> From: "GONG, Ruiqi" <gongruiqi1@xxxxxxxxxx>
>
> As suggested by Kees[1], replace the old-style 0-element array members
> of multiple structs in ebtables.h with modern C99 flexible array.
>
> [1]: https://lore.kernel.org/all/5E8E0F9C-EE3F-4B0D-B827-DC47397E2A4A@xxxxxxxxxx/
>
> Link: https://github.com/KSPP/linux/issues/21
> Signed-off-by: GONG, Ruiqi <gongruiqi1@xxxxxxxxxx>

I tried this once[1], but it was rejected pointing at a revert[2]. It
seems gcc was improved since then: The warning is gone and I don't find
-Wno-stringop-overflow flag in iptables sources.

Cheers, Phil

[1] https://lore.kernel.org/all/20200719100220.4666-1-phil@xxxxxx/
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1e6e9d0f4859ec698d55381ea26f4136eff3afe1