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

From: Gustavo A. R. Silva
Date: Fri Aug 09 2024 - 11:22:11 EST




On 08/08/24 20:46, Jakub Kicinski wrote:
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.

Nice! I'll send v2, shortly.

Thanks
--
Gustavo