From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mx.groups.io with SMTP id smtpd.web11.38783.1678120768963876976 for ; Mon, 06 Mar 2023 08:39:29 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="signature has expired" header.i=@bsdio.com header.s=fm2 header.b=qGNYYVsO; spf=pass (domain: bsdio.com, ip: 66.111.4.25, mailfrom: rebecca@bsdio.com) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 2AF7D5C036A; Mon, 6 Mar 2023 11:39:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 06 Mar 2023 11:39:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdio.com; h=cc :content-transfer-encoding:content-type:content-type:date:date :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm2; t= 1678120768; x=1678207168; bh=amNWlalfyZb6X27g7uFGWmUvzEDeXaVhHiF uKNXT/qY=; b=qGNYYVsOK+sWLGv8i9NDRVrpwkAYw+0XQ29FrLTrGKlyMZb0+eZ xRXjJ/1snIEiumPJKfYNcICkEwQ/ejPYzXobFVAiXe4vMRJv3uMCoxT82Mx4+z2D YCMmZeSlxiqgx/8M22TfU83PlwEsZ4ci6VKe2MvbvRUYkeXZWaEKVoad2GCT1wio fZjetU8tqJaqN7gN4B4QZwEyWgjblzMjmA9vDYiPkSmgGc5x8B80g6y6tYN5cHvn K1Na+OEdrjQ80AvevsEfE/zg2c70osoxeSEBAldIuaRd6BeNo3LVxb7bE32ZHAvx tmxNH4Rx/h0HbVFSTi7Th2QX4KMKjh5Bheg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1678120768; x= 1678207168; bh=amNWlalfyZb6X27g7uFGWmUvzEDeXaVhHiFuKNXT/qY=; b=q 80Z+ygZbyOvEgg6YgrcsF/3dxgPDP2PNP/FauDOQLe/ozOHL6fU07lW9XJsOn9fQ eC2gk32u2JuOGskK+Kaqtd7aI9EUCv1vjvjEBSsMyK25nbhWp+T3iAnVQC6DCTJC MKj59Jyir7CYzhBicGMvFmhbpjoGr0KRyAgdpgK24y+/RNlFvIF6ohpU0LL/3ruQ TYlsQBvyZtfjm2AM3OylRZmtvj1feqVmNgAuqRvFKER9zVPrSe6izqMHRfjT8xwn rg5bGqXV4DrOO/3KKF153hq2doeUy1j1NS5lt+Fdilg22u2g9VzEPAF9ERhjpRMa mKIFNIwNcJBKQim073K4A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvddtkedgieefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvfhfhjggtgfesthejredttdefjeenucfhrhhomheptfgvsggv tggtrgcuvehrrghnuceorhgvsggvtggtrgessghsughiohdrtghomheqnecuggftrfgrth htvghrnhepleduvedtledtvedvuedugeeuudeiiedtueduvdffueekfeejffduvdetjeev ffdvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprh gvsggvtggtrgessghsughiohdrtghomh X-ME-Proxy: Feedback-ID: i5b994698:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Mar 2023 11:39:26 -0500 (EST) Message-ID: <3fad4aa0-9bdb-715f-7b81-3f16b30be68e@bsdio.com> Date: Mon, 6 Mar 2023 09:39:25 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [edk2-devel] [PATCH 1/2] MdePkg: Update Base.h to be compliant with C11 To: devel@edk2.groups.io, quic_rcran@quicinc.com, Michael D Kinney , Liming Gao , Zhiguang Liu References: <20230209154507.81877-1-rebecca@quicinc.com> From: "Rebecca Cran" In-Reply-To: <20230209154507.81877-1-rebecca@quicinc.com> Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Now that edk2-stable202302 has been released, I'd like to get this patch series committed. -- Rebecca Cran 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") == 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 = 0xff > @@ -809,12 +809,12 @@ typedef enum { > } __VERIFY_UINT16_ENUM_SIZE; > > typedef enum { > - __VerifyUint32EnumValue = 0xffffffff > -} __VERIFY_UINT32_ENUM_SIZE; > + __VerifyInt32EnumValue = 0x7fffffff > +} __VERIFY_INT32_ENUM_SIZE; > > STATIC_ASSERT (sizeof (__VERIFY_UINT8_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); > STATIC_ASSERT (sizeof (__VERIFY_UINT16_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); > -STATIC_ASSERT (sizeof (__VERIFY_UINT32_ENUM_SIZE) == 4, "Size of enum does not meet UEFI Specification Data Type requirements"); > +STATIC_ASSERT (sizeof (__VERIFY_INT32_ENUM_SIZE) == 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