public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 1/3] MdeModulePkg/Include/UniversalPayload: Use C99 flexible arrays
@ 2023-08-24 15:54 Elyes Haouas
  2023-08-24 15:54 ` [edk2-devel] [PATCH 2/3] OvmfPkg/Library/CcExitLib: " Elyes Haouas
  2023-08-24 15:54 ` [edk2-devel] [PATCH 3/3] UefiCpuPkg/Include/Guid: " Elyes Haouas
  0 siblings, 2 replies; 3+ messages in thread
From: Elyes Haouas @ 2023-08-24 15:54 UTC (permalink / raw)
  To: devel; +Cc: Elyes Haouas

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@noos.fr>
---
 MdeModulePkg/Include/UniversalPayload/ExtraData.h      | 2 +-
 MdeModulePkg/Include/UniversalPayload/PciRootBridges.h | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/MdeModulePkg/Include/UniversalPayload/ExtraData.h b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
index 334dfd2b9e..0583fff10a 100644
--- a/MdeModulePkg/Include/UniversalPayload/ExtraData.h
+++ b/MdeModulePkg/Include/UniversalPayload/ExtraData.h
@@ -21,7 +21,7 @@ typedef struct {
 typedef struct {
   UNIVERSAL_PAYLOAD_GENERIC_HEADER      Header;
   UINT32                                Count;
-  UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY    Entry[0];
+  UNIVERSAL_PAYLOAD_EXTRA_DATA_ENTRY    Entry[];
 } UNIVERSAL_PAYLOAD_EXTRA_DATA;
 
 #pragma pack()
diff --git a/MdeModulePkg/Include/UniversalPayload/PciRootBridges.h b/MdeModulePkg/Include/UniversalPayload/PciRootBridges.h
index 37260da3b1..81f1aa3dfe 100644
--- a/MdeModulePkg/Include/UniversalPayload/PciRootBridges.h
+++ b/MdeModulePkg/Include/UniversalPayload/PciRootBridges.h
@@ -79,7 +79,7 @@ typedef struct {
   UNIVERSAL_PAYLOAD_GENERIC_HEADER     Header;
   BOOLEAN                              ResourceAssigned;
   UINT8                                Count;
-  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE    RootBridge[0];
+  UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGE    RootBridge[];
 } UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES;
 
 #pragma pack()
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108017): https://edk2.groups.io/g/devel/message/108017
Mute This Topic: https://groups.io/mt/100938776/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [edk2-devel] [PATCH 2/3] OvmfPkg/Library/CcExitLib: Use C99 flexible arrays
  2023-08-24 15:54 [edk2-devel] [PATCH 1/3] MdeModulePkg/Include/UniversalPayload: Use C99 flexible arrays Elyes Haouas
@ 2023-08-24 15:54 ` Elyes Haouas
  2023-08-24 15:54 ` [edk2-devel] [PATCH 3/3] UefiCpuPkg/Include/Guid: " Elyes Haouas
  1 sibling, 0 replies; 3+ messages in thread
From: Elyes Haouas @ 2023-08-24 15:54 UTC (permalink / raw)
  To: devel; +Cc: Elyes Haouas

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@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/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [edk2-devel] [PATCH 3/3] UefiCpuPkg/Include/Guid: Use C99 flexible arrays
  2023-08-24 15:54 [edk2-devel] [PATCH 1/3] MdeModulePkg/Include/UniversalPayload: Use C99 flexible arrays Elyes Haouas
  2023-08-24 15:54 ` [edk2-devel] [PATCH 2/3] OvmfPkg/Library/CcExitLib: " Elyes Haouas
@ 2023-08-24 15:54 ` Elyes Haouas
  1 sibling, 0 replies; 3+ messages in thread
From: Elyes Haouas @ 2023-08-24 15:54 UTC (permalink / raw)
  To: devel; +Cc: Elyes Haouas

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@noos.fr>
---
 UefiCpuPkg/Include/Guid/MicrocodePatchHob.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h b/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h
index 2772c41a16..405b53075c 100644
--- a/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h
+++ b/UefiCpuPkg/Include/Guid/MicrocodePatchHob.h
@@ -38,7 +38,7 @@ typedef struct {
   // If no microcode patch is detected for certain processor, the relating
   // element will be set to MAX_UINT64.
   //
-  UINT64    ProcessorSpecificPatchOffset[0];
+  UINT64    ProcessorSpecificPatchOffset[];
 } EDKII_MICROCODE_PATCH_HOB;
 
 #endif
-- 
2.40.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#108019): https://edk2.groups.io/g/devel/message/108019
Mute This Topic: https://groups.io/mt/100938778/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-08-24 16:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24 15:54 [edk2-devel] [PATCH 1/3] MdeModulePkg/Include/UniversalPayload: Use C99 flexible arrays Elyes Haouas
2023-08-24 15:54 ` [edk2-devel] [PATCH 2/3] OvmfPkg/Library/CcExitLib: " Elyes Haouas
2023-08-24 15:54 ` [edk2-devel] [PATCH 3/3] UefiCpuPkg/Include/Guid: " Elyes Haouas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox