[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/public: fix flexible array definitions
- To: Juergen Gross <jgross@xxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 25 Jul 2023 18:16:07 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Zhk8p+vwoO4d9BWmNqf9aqUY4Ep4CONckUbDoj5U26c=; b=h1ItWeVtf2gfagR/jdCc+KK2ld6XSFGz1OlbD8tEzbOej4FAcl2A7nJuDlSW5H3CDh00SoIA8HatxTAIAy8xcEXRkBUTSN6BDrtOfKxq7Hy3/HhzdSEgubvBaH2pIJeGOmX4cCFHiCtk7fWoG+IncEEdCT2N/JydXg3vw/XGPEr50KYNLDIvDfTa8ZPceLGOpUX9OfuOkpeVgCMetM+DaajfWO9+/z0i3Es0imSuTSncea8E8Y/YLyZRwWc4YlR0ia0ryBG29eXuXUMn/bsLjOLhMp92p0t84UqnxA01sueH9SmxNUfArbG08cIU5D8y38FB4XrrsPahisSsq/zWSw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cdcWfHXmDeI/1GW/DBAnfOHgKVHCm1Yo4kxH9zEYAEOR4eKiilW5ULosQufbBmc5xar/Bm8OW/2fS5IyLoGJEx2srCHlabkPnIZlqg+A2XucdhHoVwovU1hePyEqpxd+j16LGrcB/cuGHTRY3NZazKgFUaFkp0TK5j5xUNsP4bQf3Yq3J++RhKeUosTW4fID32GrmcZn7LAdpj0OsC44il3INKD7U1lbRNsEYzn8LdRWs5HOVHzLr9uQYYTWafJ2N1XxB4mzEZHcjioArzppG1A8jeGHX64lxZoZHJAaoaBBdScPRITh+k0e3qdVPYGY1rCFpc3cr+JhtbyegTYhrg==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 25 Jul 2023 16:16:27 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 25.07.2023 15:55, Juergen Gross wrote:
> Flexible arrays in public headers can be problematic with some
> compilers.
>
> Replace them with arr[XEN_FLEX_ARRAY_DIM] in order to avoid compilation
> errors.
>
> This includes arrays defined as "arr[1]", as seen with a recent Linux
> kernel [1].
>
> [1]: https://bugzilla.kernel.org/show_bug.cgi?id=217693
>
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
I think we need to be careful here: What if someone somewhere applies
sizeof() to any of the types you alter? The resulting value would
change with the changes you propose, which we cannot allow to happen
in a stable interface. Therefore imo it can only be an opt-in feature
to have these arrays no longer be one-element ones.
Jan
|