Re: [PATCH][next] sched: act_ct: avoid -Wflex-array-member-not-at-end warning

From: Jakub Kicinski
Date: Thu Aug 08 2024 - 22:47:10 EST


On Mon, 5 Aug 2024 09:35:46 -0600 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 structure. Notice
> that `struct zones_ht_key` is a flexible structure --a structure that
> contains a flexible-array member.

I think the flex member is there purely to mark the end of the struct.
You can use offsetofend(zone) instead of offsetof(pad), and delete pad.
--
pw-bot: cr