[edk2-devel] [Patch] MdePkg Base.h: Define STATIC_ASSERT macro as empty for EBC arch

Liming Gao posted 1 patch 4 years, 7 months ago
Failed in applying to current master (apply log)
MdePkg/Include/Base.h | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
[edk2-devel] [Patch] MdePkg Base.h: Define STATIC_ASSERT macro as empty for EBC arch
Posted by Liming Gao 4 years, 7 months ago
EBC compiler doesn't support C11 static_assert macro.
So, define STATIC_ASSERT as empty to pass EBC arch build.
STATIC_ASSERT macro is introduced @204ae9da230ecbf0910c21acac7aa5d5e8cbb8d0

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: Liming Gao <liming.gao@intel.com>
---
 MdePkg/Include/Base.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
index ed85b98318..70e4d8daf1 100644
--- a/MdePkg/Include/Base.h
+++ b/MdePkg/Include/Base.h
@@ -799,12 +799,15 @@ typedef UINTN  *BASE_LIST;
   @param  Message     Raised compiler diagnostic message when expression is false.
 
 **/
-#ifdef _MSC_EXTENSIONS
+#ifdef MDE_CPU_EBC
+  #define STATIC_ASSERT(Expression, Message)
+#elif _MSC_EXTENSIONS
   #define STATIC_ASSERT static_assert
 #else
   #define STATIC_ASSERT _Static_assert
 #endif
 
+
 //
 // Verify that ProcessorBind.h produced UEFI Data Types that are compliant with
 // Section 2.3.1 of the UEFI 2.3 Specification.
-- 
2.13.0.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47958): https://edk2.groups.io/g/devel/message/47958
Mute This Topic: https://groups.io/mt/34277056/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch] MdePkg Base.h: Define STATIC_ASSERT macro as empty for EBC arch
Posted by Philippe Mathieu-Daudé 4 years, 7 months ago
On 9/24/19 5:05 PM, Liming Gao wrote:
> EBC compiler doesn't support C11 static_assert macro.
> So, define STATIC_ASSERT as empty to pass EBC arch build.
> STATIC_ASSERT macro is introduced @204ae9da230ecbf0910c21acac7aa5d5e8cbb8d0
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> ---
>  MdePkg/Include/Base.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> index ed85b98318..70e4d8daf1 100644
> --- a/MdePkg/Include/Base.h
> +++ b/MdePkg/Include/Base.h
> @@ -799,12 +799,15 @@ typedef UINTN  *BASE_LIST;
>    @param  Message     Raised compiler diagnostic message when expression is false.
>  
>  **/
> -#ifdef _MSC_EXTENSIONS
> +#ifdef MDE_CPU_EBC
> +  #define STATIC_ASSERT(Expression, Message)
> +#elif _MSC_EXTENSIONS
>    #define STATIC_ASSERT static_assert
>  #else
>    #define STATIC_ASSERT _Static_assert
>  #endif
>  
> +
>  //
>  // Verify that ProcessorBind.h produced UEFI Data Types that are compliant with
>  // Section 2.3.1 of the UEFI 2.3 Specification.
> 

Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47966): https://edk2.groups.io/g/devel/message/47966
Mute This Topic: https://groups.io/mt/34277056/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch] MdePkg Base.h: Define STATIC_ASSERT macro as empty for EBC arch
Posted by Leif Lindholm 4 years, 7 months ago
On Tue, Sep 24, 2019 at 11:05:19PM +0800, Liming Gao wrote:
> EBC compiler doesn't support C11 static_assert macro.
> So, define STATIC_ASSERT as empty to pass EBC arch build.
> STATIC_ASSERT macro is introduced @204ae9da230ecbf0910c21acac7aa5d5e8cbb8d0
> 
> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> Signed-off-by: Liming Gao <liming.gao@intel.com>
> ---
>  MdePkg/Include/Base.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
> index ed85b98318..70e4d8daf1 100644
> --- a/MdePkg/Include/Base.h
> +++ b/MdePkg/Include/Base.h
> @@ -799,12 +799,15 @@ typedef UINTN  *BASE_LIST;
>    @param  Message     Raised compiler diagnostic message when expression is false.
>  
>  **/
> -#ifdef _MSC_EXTENSIONS
> +#ifdef MDE_CPU_EBC
> +  #define STATIC_ASSERT(Expression, Message)
> +#elif _MSC_EXTENSIONS
>    #define STATIC_ASSERT static_assert
>  #else
>    #define STATIC_ASSERT _Static_assert
>  #endif
>  
> +

Please delete this spurious added blank line.
With that:
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>

>  //
>  // Verify that ProcessorBind.h produced UEFI Data Types that are compliant with
>  // Section 2.3.1 of the UEFI 2.3 Specification.
> -- 
> 2.13.0.windows.1
> 
> 
> 
> 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#47999): https://edk2.groups.io/g/devel/message/47999
Mute This Topic: https://groups.io/mt/34277056/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch] MdePkg Base.h: Define STATIC_ASSERT macro as empty for EBC arch
Posted by Liming Gao 4 years, 7 months ago
Lefi:
  Thanks for your comment. I will update the patch when submit it. 

Thanks
Liming
>-----Original Message-----
>From: Leif Lindholm [mailto:leif.lindholm@linaro.org]
>Sent: Wednesday, September 25, 2019 8:18 AM
>To: devel@edk2.groups.io; Gao, Liming <liming.gao@intel.com>
>Cc: Kinney, Michael D <michael.d.kinney@intel.com>
>Subject: Re: [edk2-devel] [Patch] MdePkg Base.h: Define STATIC_ASSERT
>macro as empty for EBC arch
>
>On Tue, Sep 24, 2019 at 11:05:19PM +0800, Liming Gao wrote:
>> EBC compiler doesn't support C11 static_assert macro.
>> So, define STATIC_ASSERT as empty to pass EBC arch build.
>> STATIC_ASSERT macro is introduced
>@204ae9da230ecbf0910c21acac7aa5d5e8cbb8d0
>>
>> Cc: Michael D Kinney <michael.d.kinney@intel.com>
>> Signed-off-by: Liming Gao <liming.gao@intel.com>
>> ---
>>  MdePkg/Include/Base.h | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/MdePkg/Include/Base.h b/MdePkg/Include/Base.h
>> index ed85b98318..70e4d8daf1 100644
>> --- a/MdePkg/Include/Base.h
>> +++ b/MdePkg/Include/Base.h
>> @@ -799,12 +799,15 @@ typedef UINTN  *BASE_LIST;
>>    @param  Message     Raised compiler diagnostic message when expression
>is false.
>>
>>  **/
>> -#ifdef _MSC_EXTENSIONS
>> +#ifdef MDE_CPU_EBC
>> +  #define STATIC_ASSERT(Expression, Message)
>> +#elif _MSC_EXTENSIONS
>>    #define STATIC_ASSERT static_assert
>>  #else
>>    #define STATIC_ASSERT _Static_assert
>>  #endif
>>
>> +
>
>Please delete this spurious added blank line.
>With that:
>Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
>
>>  //
>>  // Verify that ProcessorBind.h produced UEFI Data Types that are compliant
>with
>>  // Section 2.3.1 of the UEFI 2.3 Specification.
>> --
>> 2.13.0.windows.1
>>
>>
>> 
>>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48000): https://edk2.groups.io/g/devel/message/48000
Mute This Topic: https://groups.io/mt/34277056/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [Patch] MdePkg Base.h: Define STATIC_ASSERT macro as empty for EBC arch
Posted by Michael D Kinney 4 years, 7 months ago
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>

> -----Original Message-----
> From: Gao, Liming <liming.gao@intel.com>
> Sent: Tuesday, September 24, 2019 5:38 PM
> To: Leif Lindholm <leif.lindholm@linaro.org>;
> devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> Subject: RE: [edk2-devel] [Patch] MdePkg Base.h: Define
> STATIC_ASSERT macro as empty for EBC arch
> 
> Lefi:
>   Thanks for your comment. I will update the patch when
> submit it.
> 
> Thanks
> Liming
> >-----Original Message-----
> >From: Leif Lindholm [mailto:leif.lindholm@linaro.org]
> >Sent: Wednesday, September 25, 2019 8:18 AM
> >To: devel@edk2.groups.io; Gao, Liming
> <liming.gao@intel.com>
> >Cc: Kinney, Michael D <michael.d.kinney@intel.com>
> >Subject: Re: [edk2-devel] [Patch] MdePkg Base.h: Define
> STATIC_ASSERT
> >macro as empty for EBC arch
> >
> >On Tue, Sep 24, 2019 at 11:05:19PM +0800, Liming Gao
> wrote:
> >> EBC compiler doesn't support C11 static_assert macro.
> >> So, define STATIC_ASSERT as empty to pass EBC arch
> build.
> >> STATIC_ASSERT macro is introduced
> >@204ae9da230ecbf0910c21acac7aa5d5e8cbb8d0
> >>
> >> Cc: Michael D Kinney <michael.d.kinney@intel.com>
> >> Signed-off-by: Liming Gao <liming.gao@intel.com>
> >> ---
> >>  MdePkg/Include/Base.h | 5 ++++-
> >>  1 file changed, 4 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/MdePkg/Include/Base.h
> b/MdePkg/Include/Base.h index
> >> ed85b98318..70e4d8daf1 100644
> >> --- a/MdePkg/Include/Base.h
> >> +++ b/MdePkg/Include/Base.h
> >> @@ -799,12 +799,15 @@ typedef UINTN  *BASE_LIST;
> >>    @param  Message     Raised compiler diagnostic
> message when expression
> >is false.
> >>
> >>  **/
> >> -#ifdef _MSC_EXTENSIONS
> >> +#ifdef MDE_CPU_EBC
> >> +  #define STATIC_ASSERT(Expression, Message) #elif
> _MSC_EXTENSIONS
> >>    #define STATIC_ASSERT static_assert  #else
> >>    #define STATIC_ASSERT _Static_assert  #endif
> >>
> >> +
> >
> >Please delete this spurious added blank line.
> >With that:
> >Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
> >
> >>  //
> >>  // Verify that ProcessorBind.h produced UEFI Data
> Types that are
> >> compliant
> >with
> >>  // Section 2.3.1 of the UEFI 2.3 Specification.
> >> --
> >> 2.13.0.windows.1
> >>
> >>
> >> 
> >>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#48009): https://edk2.groups.io/g/devel/message/48009
Mute This Topic: https://groups.io/mt/34277056/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-