[edk2-devel] [PATCH 18/18] FmpDevicePkg: Update code to be more C11 compliant by using __func__
Xu, Wei6
wei6.xu at intel.com
Mon Apr 10 01:05:42 UTC 2023
Reviewed-by: Wei6 Xu <wei6.xu at intel.com>
Thanks,
Wei
-----Original Message-----
From: Rebecca Cran <rebecca at bsdio.com>
Sent: Friday, April 7, 2023 6:23 AM
To: devel at edk2.groups.io; Gao, Liming <gaoliming at byosoft.com.cn>; Kinney, Michael D <michael.d.kinney at intel.com>; Jiang, Guomin <guomin.jiang at intel.com>; Xu, Wei6 <wei6.xu at intel.com>; Dong, Guo <guo.dong at intel.com>; Ni, Ray <ray.ni at intel.com>; Rhodes, Sean <sean at starlabs.systems>; Lu, James <james.lu at intel.com>; Guo, Gua <gua.guo at intel.com>; Andrew Fish <afish at apple.com>; Wu, Hao A <hao.a.wu at intel.com>; Maciej Rabeda <maciej.rabeda at linux.intel.com>; Siyuan Fu <siyuan.fu at intel.com>; Yao, Jiewen <jiewen.yao at intel.com>; Wang, Jian J <jian.j.wang at intel.com>; Lu, Xiaoyu1 <xiaoyu1.lu at intel.com>; Ard Biesheuvel <ardb+tianocore at kernel.org>; Sami Mujawar <sami.mujawar at arm.com>; Supreeth Venkatesh <supreeth.venkatesh at arm.com>; Michael Kubacki <mikuback at linux.microsoft.com>; Desimone, Nathaniel L <nathaniel.l.desimone at intel.com>; Sean Brogan <sean.brogan at microsoft.com>
Cc: Rebecca Cran <rebecca at bsdio.com>; Leif Lindholm <quic_llindhol at quicinc.com>; Abner Chang <abner.chang at amd.com>; Nickle Wang <nicklew at nvidia.com>; Igor Kulchytskyy <igork at ami.com>; Daniel Schaefer <git at danielschaefer.me>; Xu, Min M <min.m.xu at intel.com>; Justen, Jordan L <jordan.l.justen at intel.com>; Gerd Hoffmann <kraxel at redhat.com>; Peter Grehan <grehan at freebsd.org>; Aktas, Erdem <erdemaktas at google.com>; James Bottomley <jejb at linux.ibm.com>; Tom Lendacky <thomas.lendacky at amd.com>; Michael Roth <michael.roth at amd.com>; Sunil V L <sunilvl at ventanamicro.com>; Warkentin, Andrei <andrei.warkentin at intel.com>
Subject: [PATCH 18/18] FmpDevicePkg: Update code to be more C11 compliant by using __func__
__FUNCTION__ is a pre-standard extension that gcc and Visual C++ among others support, while __func__ was standardized in C99.
Since it's more standard, replace __FUNCTION__ with __func__ throughout FmpDevicePkg.
Visual Studio versions before VS 2015 don't support __func__ and so will fail to compile. A workaround is to define __func__ as __FUNCTION__ :
#define __func__ __FUNCTION__
Signed-off-by: Rebecca Cran <rebecca at bsdio.com>
---
FmpDevicePkg/FmpDxe/VariableSupport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/FmpDevicePkg/FmpDxe/VariableSupport.c b/FmpDevicePkg/FmpDxe/VariableSupport.c
index 541e5e0f5fc7..5126c5e2d556 100644
--- a/FmpDevicePkg/FmpDxe/VariableSupport.c
+++ b/FmpDevicePkg/FmpDxe/VariableSupport.c
@@ -832,7 +832,7 @@ LockAllFmpVariables (
// Locate the VariablePolicy protocol.
Status = gBS->LocateProtocol (&gEdkiiVariablePolicyProtocolGuid, NULL, (VOID **)&VariablePolicy);
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR, "FmpDxe %a - Could not locate VariablePolicy protocol! %r\n", __FUNCTION__, Status));
+ DEBUG ((DEBUG_ERROR, "FmpDxe %a - Could not locate VariablePolicy
+ protocol! %r\n", __func__, Status));
return Status;
}
--
2.34.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#102752): https://edk2.groups.io/g/devel/message/102752
Mute This Topic: https://groups.io/mt/98115258/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list