public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Rebecca Cran" <rebecca@bsdio.com>
To: gaoliming <gaoliming@byosoft.com.cn>,
	devel@edk2.groups.io,
	'Michael D Kinney' <michael.d.kinney@intel.com>,
	'Zhiguang Liu' <zhiguang.liu@intel.com>
Subject: Re: 回复: [edk2-devel] [PATCH 1/2] MdePkg: Update Base.h to be compliant with C11
Date: Fri, 10 Mar 2023 10:58:26 -0700	[thread overview]
Message-ID: <3e673abe-efd1-e92b-4f6c-ff9f1d823209@bsdio.com> (raw)
In-Reply-To: <009601d952fa$5a1fb7b0$0e5f2710$@byosoft.com.cn>

Yes. Now that the MdePkg change has been reviewed and will be committed, 
I'll proceed with submitting patches for the other packages.


-- 

Rebecca Cran


On 3/9/23 7:45 PM, gaoliming wrote:
> 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
>> -----邮件原件-----
>> 发件人: Rebecca Cran <rebecca@bsdio.com>
>> 发送时间: 2023年3月7日 0:39
>> 收件人: devel@edk2.groups.io; quic_rcran@quicinc.com; Michael D Kinney
>> <michael.d.kinney@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>;
>> Zhiguang Liu <zhiguang.liu@intel.com>
>> 主题: Re: [edk2-devel] [PATCH 1/2] MdePkg: Update Base.h to be compliant
>> with C11
>>
>> 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 <rebecca@quicinc.com>
>>> ---
>>>    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
>

  reply	other threads:[~2023-03-10 17:58 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-09 15:45 [PATCH 1/2] MdePkg: Update Base.h to be compliant with C11 Rebecca Cran
2023-02-09 15:45 ` [PATCH 2/2] MdePkg: Update code to be more C11 compliant by using __func__ Rebecca Cran
2023-02-10  1:01   ` [edk2-devel] " Michael D Kinney
2023-02-10  1:21     ` Rebecca Cran
2023-02-10 11:45       ` Ard Biesheuvel
2023-02-10 15:19         ` Leif Lindholm
2023-02-10 18:16           ` Michael D Kinney
2023-02-12 19:59     ` Rebecca Cran
2023-03-14  2:19     ` Rebecca Cran
2023-03-14 20:40       ` Michael D Kinney
2023-03-17 13:31         ` Rebecca Cran
2023-03-17 15:16           ` Michael D Kinney
2023-03-22 16:58             ` Michael D Kinney
2023-03-22 17:45               ` Rebecca Cran
2023-03-23  0:58                 ` Michael D Kinney
2023-03-23  1:43                   ` Huang, Yanbo
2023-03-23  1:46                     ` Rebecca Cran
2023-03-17  4:23   ` Sunil V L
2023-02-10  1:03 ` [edk2-devel] [PATCH 1/2] MdePkg: Update Base.h to be compliant with C11 Michael D Kinney
2023-02-10  1:14   ` Rebecca Cran
2023-02-10  4:15     ` Rebecca Cran
2023-03-06 16:39 ` Rebecca Cran
2023-03-10  2:45   ` 回复: " gaoliming
2023-03-10 17:58     ` Rebecca Cran [this message]
2023-03-13 17:54     ` Rebecca Cran
2023-03-13 20:46       ` Michael D Kinney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3e673abe-efd1-e92b-4f6c-ff9f1d823209@bsdio.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox