Reviewed-by: Michael Kinney <michael.d.kin...@intel.com>

Mike


> -----Original Message-----
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Hao Wu
> Sent: Friday, February 26, 2016 2:53 AM
> To: edk2-devel@lists.01.org; Kinney, Michael D <michael.d.kin...@intel.com>; 
> Fan, Jeff
> <jeff....@intel.com>
> Cc: Wu, Hao A <hao.a...@intel.com>
> Subject: [edk2] [PATCH] UefiCpuPkg/Cpuid: Fix GCC build error
> 
> define PRINT_BIT_FIELD(Variable, FieldName) \
>   Print (L"%5a%42a: %x\n", #Variable, #FieldName, \
>   ##Variable.Bits.##FieldName);
> 
> The above definition in UefiCpuPkg/Application/Cpuid/Cpuid.c
> will cause GCC build error.
> 
> Fix it with:
> 
> define PRINT_BIT_FIELD(Variable, FieldName) \
>   Print (L"%5a%42a: %x\n", #Variable, #FieldName, \
>   Variable.Bits.FieldName);
> 
> The '.' has its origin meaning as a member operator in the define
> statement. Thus, the token-pasting operator '##' is not necessary here.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Hao Wu <hao.a...@intel.com>
> ---
>  UefiCpuPkg/Application/Cpuid/Cpuid.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/UefiCpuPkg/Application/Cpuid/Cpuid.c
> b/UefiCpuPkg/Application/Cpuid/Cpuid.c
> index f82e43f..366c3ca 100644
> --- a/UefiCpuPkg/Application/Cpuid/Cpuid.c
> +++ b/UefiCpuPkg/Application/Cpuid/Cpuid.c
> @@ -21,7 +21,7 @@
>  /// Macro used to display the value of a bit field in a register returned by 
> CPUID.
>  ///
>  #define PRINT_BIT_FIELD(Variable, FieldName) \
> -  Print (L"%5a%42a: %x\n", #Variable, #FieldName, 
> ##Variable.Bits.##FieldName);
> +  Print (L"%5a%42a: %x\n", #Variable, #FieldName, Variable.Bits.FieldName);
> 
>  ///
>  /// Macro used to display the value of a register returned by CPUID.
> --
> 1.9.5.msysgit.0
> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to