Hello all!

while I see the code. I have one question related using Flexible Array Member.

For example)

///
/// Socket Type Data.
///
typedef struct {
  EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE CommonMemoryDeviceHeader;
  UINT16 SocketIdentifier;
  UINT16 Reserved;
  // EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE MemoryDeviceStructure[];
} EFI_ACPI_6_4_PMTT_SOCKET_TYPE_DATA;

In here, why MemoryDeviceStructure should remain with comments?

IIUC, edk2 coding style guide doesn't seem to prevent use of Flexible Array Member which is C99 standard.

And consider the compiler used to compile edk2 uses defaults standard above of C99 standard.

Couldn't I use the flexible array member like:

///
/// Socket Type Data.
///
typedef struct {
  EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE CommonMemoryDeviceHeader;
  UINT16 SocketIdentifier;
  UINT16 Reserved;
  EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE  MemoryDeviceStructure[]
}

Thanks!


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117365): https://edk2.groups.io/g/devel/message/117365
Mute This Topic: https://groups.io/mt/105305209/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to