public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] [PATCH 1/6] UefiPayloadPkg: Use C99 flexible arrays
@ 2023-08-24  6:07 Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 2/6] CryptoPkg/Include/Library:: " Elyes Haouas
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Elyes Haouas @ 2023-08-24  6:07 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>
---
 UefiPayloadPkg/Include/Coreboot.h                    | 12 ++++++------
 UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h      |  2 +-
 UefiPayloadPkg/Include/Guid/PayloadCommandLine.h     |  2 +-
 UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h    |  2 +-
 .../Include/Guid/SmmS3CommunicationInfoGuid.h        |  2 +-
 5 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/UefiPayloadPkg/Include/Coreboot.h b/UefiPayloadPkg/Include/Coreboot.h
index 2d454f7c89..caf15e1356 100644
--- a/UefiPayloadPkg/Include/Coreboot.h
+++ b/UefiPayloadPkg/Include/Coreboot.h
@@ -59,7 +59,7 @@ struct cbmem_root {
   UINT32                num_entries;
   UINT32                locked;
   UINT32                size;
-  struct cbmem_entry    entries[0];
+  struct cbmem_entry    entries[];
 };
 
 struct imd_entry {
@@ -75,7 +75,7 @@ struct imd_root {
   UINT32              flags;
   UINT32              entry_align;
   UINT32              max_offset;
-  struct imd_entry    entries[0];
+  struct imd_entry    entries[];
 };
 
 struct cbuint64 {
@@ -119,7 +119,7 @@ struct cb_memory_range {
 struct cb_memory {
   UINT32                    tag;
   UINT32                    size;
-  struct cb_memory_range    map[0];
+  struct cb_memory_range    map[];
 };
 
 #define CB_TAG_MAINBOARD  0x0003
@@ -129,7 +129,7 @@ struct cb_mainboard {
   UINT32    size;
   UINT8     vendor_idx;
   UINT8     part_number_idx;
-  UINT8     strings[0];
+  UINT8     strings[];
 };
 
 #define CB_TAG_VERSION         0x0004
@@ -146,7 +146,7 @@ struct cb_mainboard {
 struct cb_string {
   UINT32    tag;
   UINT32    size;
-  UINT8     string[0];
+  UINT8     string[];
 };
 
 #define CB_TAG_SERIAL  0x000f
@@ -239,7 +239,7 @@ struct cb_vdat {
 struct cbmem_console {
   UINT32    size;
   UINT32    cursor;
-  UINT8     body[0];
+  UINT8     body[];
 } __attribute__ ((packed));
 
 #define CB_TAG_MRC_CACHE  0x0018
diff --git a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h b/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
index 1b9b2b7fbc..e25730d85f 100644
--- a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h
@@ -29,7 +29,7 @@ typedef struct {
   UINT8               Revision;
   UINT8               Reserved0[3];
   UINT32              Count;
-  MEMORY_MAP_ENTRY    Entry[0];
+  MEMORY_MAP_ENTRY    Entry[];
 } MEMORY_MAP_INFO;
 #pragma pack()
 
diff --git a/UefiPayloadPkg/Include/Guid/PayloadCommandLine.h b/UefiPayloadPkg/Include/Guid/PayloadCommandLine.h
index 845a30efe1..6a73c79e9d 100644
--- a/UefiPayloadPkg/Include/Guid/PayloadCommandLine.h
+++ b/UefiPayloadPkg/Include/Guid/PayloadCommandLine.h
@@ -17,7 +17,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 typedef struct {
   UNIVERSAL_PAYLOAD_GENERIC_HEADER    Header;
   UINT32                              Count;
-  CHAR8                               CommandLine[0];
+  CHAR8                               CommandLine[];
 } UNIVERSAL_PAYLOAD_COMMAND_LINE;
 
 #pragma pack()
diff --git a/UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h b/UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h
index 665eaa7e77..f6761e1997 100644
--- a/UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h
@@ -39,7 +39,7 @@ typedef struct {
   UINT16                  Revision;
   UINT16                  Reserved;
   UINT32                  Count;
-  PLD_GENERIC_REGISTER    Registers[0];
+  PLD_GENERIC_REGISTER    Registers[];
 } PLD_SMM_REGISTERS;
 
 #pragma pack()
diff --git a/UefiPayloadPkg/Include/Guid/SmmS3CommunicationInfoGuid.h b/UefiPayloadPkg/Include/Guid/SmmS3CommunicationInfoGuid.h
index 0f7006a5f4..96ed52d872 100644
--- a/UefiPayloadPkg/Include/Guid/SmmS3CommunicationInfoGuid.h
+++ b/UefiPayloadPkg/Include/Guid/SmmS3CommunicationInfoGuid.h
@@ -36,7 +36,7 @@ typedef struct {
   UINT8          SwSmiTriggerValue;
   UINT16         Reserved;
   UINT32         CpuCount;
-  CPU_SMMBASE    SmmBase[0];
+  CPU_SMMBASE    SmmBase[];
 } SMM_S3_INFO;
 
 //
-- 
2.40.1



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

* [edk2-devel] [PATCH 2/6] CryptoPkg/Include/Library:: Use C99 flexible arrays
  2023-08-24  6:07 [edk2-devel] [PATCH 1/6] UefiPayloadPkg: Use C99 flexible arrays Elyes Haouas
@ 2023-08-24  6:07 ` Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 3/6] EmulatorPkg/Include/Ppi:: " Elyes Haouas
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Elyes Haouas @ 2023-08-24  6:07 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>
---
 CryptoPkg/Include/Library/BaseCryptLib.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/CryptoPkg/Include/Library/BaseCryptLib.h b/CryptoPkg/Include/Library/BaseCryptLib.h
index a52bd91ad6..6bf500c888 100644
--- a/CryptoPkg/Include/Library/BaseCryptLib.h
+++ b/CryptoPkg/Include/Library/BaseCryptLib.h
@@ -2167,7 +2167,7 @@ Pkcs1v2Encrypt (
 
 typedef struct {
   UINT32    CertDataLength;       // The length in bytes of X.509 certificate.
-  UINT8     CertDataBuffer[0];    // The X.509 certificate content (DER).
+  UINT8     CertDataBuffer[];    // The X.509 certificate content (DER).
 } EFI_CERT_DATA;
 
 typedef struct {
-- 
2.40.1



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

* [edk2-devel] [PATCH 3/6] EmulatorPkg/Include/Ppi:: Use C99 flexible arrays
  2023-08-24  6:07 [edk2-devel] [PATCH 1/6] UefiPayloadPkg: Use C99 flexible arrays Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 2/6] CryptoPkg/Include/Library:: " Elyes Haouas
@ 2023-08-24  6:07 ` Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 4/6] MdeModulePkg/Include/Guid:: " Elyes Haouas
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Elyes Haouas @ 2023-08-24  6:07 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>
---
 EmulatorPkg/Include/Ppi/EmuThunk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/EmulatorPkg/Include/Ppi/EmuThunk.h b/EmulatorPkg/Include/Ppi/EmuThunk.h
index c78ad692ed..7bc6feec4d 100644
--- a/EmulatorPkg/Include/Ppi/EmuThunk.h
+++ b/EmulatorPkg/Include/Ppi/EmuThunk.h
@@ -111,7 +111,7 @@ typedef struct {
   CHAR8                      **Argv;
   CHAR8                      **Envp;
   UINTN                      PersistentMemorySize;
-  UINT8                      PersistentMemory[0];
+  UINT8                      PersistentMemory[];
 } EMU_THUNK_PPI;
 
 extern EFI_GUID  gEmuThunkPpiGuid;
-- 
2.40.1



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

* [edk2-devel] [PATCH 4/6] MdeModulePkg/Include/Guid:: Use C99 flexible arrays
  2023-08-24  6:07 [edk2-devel] [PATCH 1/6] UefiPayloadPkg: Use C99 flexible arrays Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 2/6] CryptoPkg/Include/Library:: " Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 3/6] EmulatorPkg/Include/Ppi:: " Elyes Haouas
@ 2023-08-24  6:07 ` Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 5/6] MdeModulePkg/Universal/ResetSystemPei: " Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 6/6] UefiCpuPkg/Library/CpuPageTableLib: " Elyes Haouas
  4 siblings, 0 replies; 6+ messages in thread
From: Elyes Haouas @ 2023-08-24  6:07 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/Guid/ExtendedFirmwarePerformance.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h b/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h
index 20be7654c8..25dfc5b86b 100644
--- a/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h
+++ b/MdeModulePkg/Include/Guid/ExtendedFirmwarePerformance.h
@@ -107,7 +107,7 @@ typedef struct {
   /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
   /// It may be module name, function name, or token name.
   ///
-  CHAR8                                          String[0];
+  CHAR8                                          String[];
 } FPDT_DYNAMIC_STRING_EVENT_RECORD;
 
 //
@@ -143,7 +143,7 @@ typedef struct {
   /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
   /// It is the function name.
   ///
-  CHAR8                                          String[0];
+  CHAR8                                          String[];
 } FPDT_DUAL_GUID_STRING_EVENT_RECORD;
 
 //
@@ -209,7 +209,7 @@ typedef struct {
   ///
   /// ASCII string describing the module. Padding supplied at the end if necessary with null characters (0x00).
   ///
-  CHAR8                                          String[0];
+  CHAR8                                          String[];
 } FPDT_GUID_QWORD_STRING_EVENT_RECORD;
 
 #pragma pack()
-- 
2.40.1



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

* [edk2-devel] [PATCH 5/6] MdeModulePkg/Universal/ResetSystemPei: Use C99 flexible arrays
  2023-08-24  6:07 [edk2-devel] [PATCH 1/6] UefiPayloadPkg: Use C99 flexible arrays Elyes Haouas
                   ` (2 preceding siblings ...)
  2023-08-24  6:07 ` [edk2-devel] [PATCH 4/6] MdeModulePkg/Include/Guid:: " Elyes Haouas
@ 2023-08-24  6:07 ` Elyes Haouas
  2023-08-24  6:07 ` [edk2-devel] [PATCH 6/6] UefiCpuPkg/Library/CpuPageTableLib: " Elyes Haouas
  4 siblings, 0 replies; 6+ messages in thread
From: Elyes Haouas @ 2023-08-24  6:07 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/Universal/ResetSystemPei/ResetSystem.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
index a04e4840e6..28bad474e1 100644
--- a/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
+++ b/MdeModulePkg/Universal/ResetSystemPei/ResetSystem.h
@@ -36,7 +36,7 @@
 typedef struct {
   UINT32              Signature;
   UINT32              Count;
-  EFI_RESET_SYSTEM    ResetFilters[0];             // ResetFilters[PcdGet32 (PcdMaximumResetNotifies)]
+  EFI_RESET_SYSTEM    ResetFilters[];             // ResetFilters[PcdGet32 (PcdMaximumResetNotifies)]
 } RESET_FILTER_LIST;
 #define RESET_FILTER_LIST_SIGNATURE  SIGNATURE_32('r', 's', 't', 'l')
 
-- 
2.40.1



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

* [edk2-devel] [PATCH 6/6] UefiCpuPkg/Library/CpuPageTableLib: Use C99 flexible arrays
  2023-08-24  6:07 [edk2-devel] [PATCH 1/6] UefiPayloadPkg: Use C99 flexible arrays Elyes Haouas
                   ` (3 preceding siblings ...)
  2023-08-24  6:07 ` [edk2-devel] [PATCH 5/6] MdeModulePkg/Universal/ResetSystemPei: " Elyes Haouas
@ 2023-08-24  6:07 ` Elyes Haouas
  4 siblings, 0 replies; 6+ messages in thread
From: Elyes Haouas @ 2023-08-24  6:07 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/Library/CpuPageTableLib/UnitTest/RandomTest.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.h b/UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.h
index cdc81e0af3..56382dd5d5 100644
--- a/UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.h
+++ b/UefiCpuPkg/Library/CpuPageTableLib/UnitTest/RandomTest.h
@@ -29,7 +29,7 @@ struct _ALLOCATE_PAGE_RECORDS {
   UINTN                   Count;
   UINTN                   MaxCount;
   ALLOCATE_PAGES          AllocatePagesForPageTable;
-  ALLOCATE_PAGE_RECORD    Records[0];
+  ALLOCATE_PAGE_RECORD    Records[];
 };
 
 typedef struct {
-- 
2.40.1



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

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

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-24  6:07 [edk2-devel] [PATCH 1/6] UefiPayloadPkg: Use C99 flexible arrays Elyes Haouas
2023-08-24  6:07 ` [edk2-devel] [PATCH 2/6] CryptoPkg/Include/Library:: " Elyes Haouas
2023-08-24  6:07 ` [edk2-devel] [PATCH 3/6] EmulatorPkg/Include/Ppi:: " Elyes Haouas
2023-08-24  6:07 ` [edk2-devel] [PATCH 4/6] MdeModulePkg/Include/Guid:: " Elyes Haouas
2023-08-24  6:07 ` [edk2-devel] [PATCH 5/6] MdeModulePkg/Universal/ResetSystemPei: " Elyes Haouas
2023-08-24  6:07 ` [edk2-devel] [PATCH 6/6] UefiCpuPkg/Library/CpuPageTableLib: " Elyes Haouas

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