[edk2-devel] [PATCH 2/3] OvmfPkg/Library/CcExitLib: Use C99 flexible arrays

Elyes Haouas ehaouas at noos.fr
Thu Aug 24 15:54:36 UTC 2023


One-element or zero-length arrays have been deprecated since
last millennium.
Use C99 flexible arrays instead, it allows the compiler to
generate errors when the flexible array does not occur at the
end in the structure.

Signed-off-by: Elyes Haouas <ehaouas at noos.fr>
---
 OvmfPkg/Library/CcExitLib/CcExitVcHandler.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c
index 0fc30f7bc4..17d6c72e8e 100644
--- a/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c
+++ b/OvmfPkg/Library/CcExitLib/CcExitVcHandler.c
@@ -52,7 +52,7 @@ typedef PACKED struct {
   UINT32                    Count;
   UINT32                    Reserved1;
   UINT64                    Reserved2;
-  SEV_SNP_CPUID_FUNCTION    function[0];
+  SEV_SNP_CPUID_FUNCTION    function[];
 } SEV_SNP_CPUID_INFO;
 
 /**
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108018): https://edk2.groups.io/g/devel/message/108018
Mute This Topic: https://groups.io/mt/100938777/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