Re: [PATCH][next] iommufd/iommufd_private.h: Avoid -Wflex-array-member-not-at-end warning
From: Nicolin Chen
Date: Mon Nov 10 2025 - 13:05:36 EST
On Mon, Nov 10, 2025 at 08:35:31PM +0900, 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 iommufd_vevent is a flexible
> structure, this is a structure that contains a flexible-array
> member.
>
> Fix the following warning:
>
> drivers/iommu/iommufd/iommufd_private.h:621:31: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
IIUIC, there might be data corruption due to this? If so, I think
we should do:
[PATCH rc] iommufd: Fix flex-array-member-not-at-end in struct iommufd_veventq
And add:
Fixes: e36ba5ab808e ("iommufd: Add IOMMUFD_OBJ_VEVENTQ and IOMMUFD_CMD_VEVENTQ_ALLOC")
Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Gustavo A. R. Silva <gustavoars@xxxxxxxxxx>
With that,
Reviewed-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
Thanks for the patch!