From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from walk.intel-email.com (walk.intel-email.com [101.227.64.242]) by mx.groups.io with SMTP id smtpd.web10.10292.1678416329634051412 for ; Thu, 09 Mar 2023 18:45:30 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@byosoft.com.cn header.s=cloud-union header.b=cPM8Pz4j; spf=pass (domain: byosoft.com.cn, ip: 101.227.64.242, mailfrom: gaoliming@byosoft.com.cn) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 66EE1CD1F679 for ; Fri, 10 Mar 2023 10:45:26 +0800 (CST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=byosoft.com.cn; s=cloud-union; t=1678416326; bh=kD41KlEjNi2jE7csniVx2xwMkqZCtfd9eIiXO3K1Cic=; h=From:To:References:In-Reply-To:Subject:Date; b=cPM8Pz4jHl0dSnyw9lof3dRYyePEKQXohfJpiQadqD1SPJ9U2RmYuDhjDxp+YZjrx Nmv+qiey2IvN7PLtNlA8RHP+1d1sKPKTJoZsdlQHmOg0OFFHW0QuPq7KdERCmxIx/Z 2CBQm32DxvKIe/3b7xE6NPsZmGrzUSS6BrwXfNQw= Received: from localhost (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 62813CD1F657 for ; Fri, 10 Mar 2023 10:45:26 +0800 (CST) Received: from walk.intel-email.com (localhost [127.0.0.1]) by walk.intel-email.com (Postfix) with ESMTP id 35BFFCD1F637 for ; Fri, 10 Mar 2023 10:45:26 +0800 (CST) Authentication-Results: walk.intel-email.com; none Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by walk.intel-email.com (Postfix) with SMTP id C7F69CD1F64C for ; Fri, 10 Mar 2023 10:45:23 +0800 (CST) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Fri, 10 Mar 2023 10:45:15 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Rebecca Cran'" , , , "'Michael D Kinney'" , "'Zhiguang Liu'" References: <20230209154507.81877-1-rebecca@quicinc.com> <3fad4aa0-9bdb-715f-7b81-3f16b30be68e@bsdio.com> In-Reply-To: <3fad4aa0-9bdb-715f-7b81-3f16b30be68e@bsdio.com> Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIDEvMl0gTWRlUGtnOiBVcGRhdGUgQmFzZS5oIHRvIGJlIGNvbXBsaWFudCB3aXRoIEMxMQ==?= Date: Fri, 10 Mar 2023 10:45:18 +0800 Message-ID: <009601d952fa$5a1fb7b0$0e5f2710$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQE5idSUWk67xLXmpfTqPwUZACNBIAE+aM4CsCjtQqA= Sender: "gaoliming" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Rebecca: This patch pass code review. It can be merged now. The second change = to using __func__ is only for MdePkg. Do you expect the change in MdePkg = is first merged? Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Rebecca Cran > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: = 2023=E5=B9=B43=E6=9C=887=E6=97=A5 0:39 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; = quic_rcran@quicinc.com; Michael D Kinney > ; Liming Gao ; > Zhiguang Liu > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH 1/2] MdePkg: Update Base.h = to be compliant > with C11 >=20 > Now that edk2-stable202302 has been released, I'd like to get this = patch > series committed. >=20 >=20 > -- > Rebecca Cran >=20 >=20 > On 2/9/23 8:45 AM, Rebecca Cran wrote: > > With the introduction of the use of _Static_assert, edk2 requires a = C11 > > compatible compiler. Update Include/Base.h to be compliant with C11. > > > > As of C11, the maximum type of an enum is type `int`. Since the UEFI > > Specification 2.3.1 Errata C allows either `int` or `unsigned int`, = fix > > the 32-bit enum check to use a signed int. > > > > Since the UEFI 2.3 Specification only allowed signed int, update the > > comment to reference 2.3.1 Errata C where the change was made to = allow > > unsigned int. > > > > Signed-off-by: Rebecca Cran > > --- > > MdePkg/Include/Base.h | 12 ++++++------ > > 1 file changed, 6 insertions(+), 6 deletions(-) > > > > diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h > > index d209e6de280a..e89c84962ab2 100644 > > --- a/MdePkg/Include/Base.h > > +++ b/MdePkg/Include/Base.h > > @@ -796,9 +796,9 @@ STATIC_ASSERT (sizeof (L"A") =3D=3D 4, = "sizeof > (L\"A\") does not meet UEFI Specif > > // > > // The following three enum types are used to verify that the = compiler > > // configuration for enum types is compliant with Section 2.3.1 of = the > > -// UEFI 2.3 Specification. These enum types and enum values are not > > -// intended to be used. A prefix of '__' is used avoid conflicts = with > > -// other types. > > +// UEFI 2.3.1 Errata C Specification. These enum types and enum = values > > +// are not intended to be used. A prefix of '__' is used avoid > > +// conflicts with other types. > > // > > typedef enum { > > __VerifyUint8EnumValue =3D 0xff > > @@ -809,12 +809,12 @@ typedef enum { > > } __VERIFY_UINT16_ENUM_SIZE; > > > > typedef enum { > > - __VerifyUint32EnumValue =3D 0xffffffff > > -} __VERIFY_UINT32_ENUM_SIZE; > > + __VerifyInt32EnumValue =3D 0x7fffffff > > +} __VERIFY_INT32_ENUM_SIZE; > > > > STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) =3D=3D 4, "Size = of > enum does not meet UEFI Specification Data Type requirements"); > > STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) =3D=3D 4, "Size = of > enum does not meet UEFI Specification Data Type requirements"); > > -STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) =3D=3D 4, "Size = of > enum does not meet UEFI Specification Data Type requirements"); > > +STATIC_ASSERT (sizeof (__VERIFY_INT32_ENUM_SIZE) =3D=3D 4, "Size of = enum > does not meet UEFI Specification Data Type requirements"); > > > > /** > > Macro that returns a pointer to the data structure that contains = a > specified field of