Re: [PATCH][next] net: airoha: Avoid -Wflex-array-member-not-at-end warning

From: Simon Horman

Date: Tue Sep 23 2025 - 14:55:29 EST


On Mon, Sep 22, 2025 at 04:08:21PM +0200, Gustavo A. R. Silva wrote:
> -Wflex-array-member-not-at-end was introduced in GCC-14, and we are
> getting ready to enable it, globally.
>
> Move the conflicting declaration to the end of the corresponding
> structure. Notice that `struct airoha_foe_entry` is a flexible
> structure, this is a structure that contains a flexible-array
> member.
>
> Fix the following warning:
>
> drivers/net/ethernet/airoha/airoha_eth.h:474:33: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]

FWIIW, I was able to reproduce this locally.
And it goes away with this patch applied.

>
> Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
> ---
> drivers/net/ethernet/airoha/airoha_eth.h | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Simon Horman <horms@xxxxxxxxxx>

...