From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 57D917803CC for ; Thu, 24 Aug 2023 14:15:12 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=eQFLw4gdlcUOkeDzRgNBQEHYBgXTErjoyYNU0OkNvsU=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1692886511; v=1; b=I0WkakD8Q+zj2LylAw9TSR8VIDHiheZ/llNdQuPYwYIMcHHvec+NEENBa240rSmIn0r6sCX3 KX2NnnTofVWQt950O25S3kJmjeHNvbxVZiPelSN6mPuSOWiu2cptpVWMsdYTKx5MmjOWjyLW/5s pKqtiUcBBZnFLZ4tpJz8tIfg= X-Received: by 127.0.0.2 with SMTP id N4siYY7687511xshIrASf6Ep; Thu, 24 Aug 2023 07:15:11 -0700 X-Received: from smtp26.services.sfr.fr (smtp26.services.sfr.fr [93.17.128.212]) by mx.groups.io with SMTP id smtpd.web10.4927.1692857260899169215 for ; Wed, 23 Aug 2023 23:07:41 -0700 X-mail-filterd: {"version":"1.7.1","queueID":"4RWXgH0P5rz1LQKdQ","contextId": "1cf7420f-0157-4d11-8a6d-8a7a40cd8f07"} X-Received: from localhost.localdomain (179.211.201.77.rev.sfr.net [77.201.211.179]) by msfrf2636.sfr.fr (SMTP Server) with ESMTP id 4RWXgH0P5rz1LQKdQ; Thu, 24 Aug 2023 08:07:39 +0200 (CEST) X-mail-filterd: {"version":"1.7.1","queueID":"4RWXgG6HlLz1LQKdP","contextId": "0fa1102d-6ddc-4f09-8545-739e405a4d45"} X-sfr-mailing: LEGIT X-sfr-spamrating: 40 X-sfr-spam: not-spam X-Received: from localhost.localdomain (179.211.201.77.rev.sfr.net [77.201.211.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ehaouas@noos.fr) by msfrf2636.sfr.fr (SMTP Server) with ESMTPSA id 4RWXgG6HlLz1LQKdP; Thu, 24 Aug 2023 08:07:38 +0200 (CEST) From: Elyes Haouas To: devel@edk2.groups.io Cc: Elyes Haouas Subject: [edk2-devel] [PATCH 1/6] UefiPayloadPkg: Use C99 flexible arrays Date: Thu, 24 Aug 2023 08:07:31 +0200 Message-Id: <20230824060736.3543-1-ehaouas@noos.fr> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ehaouas@noos.fr List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: IhodAgWfGl7XSEBQdnUF1nSGx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=I0WkakD8; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 --- 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/Cor= eboot.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;=0D UINT32 locked;=0D UINT32 size;=0D - struct cbmem_entry entries[0];=0D + struct cbmem_entry entries[];=0D };=0D =0D struct imd_entry {=0D @@ -75,7 +75,7 @@ struct imd_root { UINT32 flags;=0D UINT32 entry_align;=0D UINT32 max_offset;=0D - struct imd_entry entries[0];=0D + struct imd_entry entries[];=0D };=0D =0D struct cbuint64 {=0D @@ -119,7 +119,7 @@ struct cb_memory_range { struct cb_memory {=0D UINT32 tag;=0D UINT32 size;=0D - struct cb_memory_range map[0];=0D + struct cb_memory_range map[];=0D };=0D =0D #define CB_TAG_MAINBOARD 0x0003=0D @@ -129,7 +129,7 @@ struct cb_mainboard { UINT32 size;=0D UINT8 vendor_idx;=0D UINT8 part_number_idx;=0D - UINT8 strings[0];=0D + UINT8 strings[];=0D };=0D =0D #define CB_TAG_VERSION 0x0004=0D @@ -146,7 +146,7 @@ struct cb_mainboard { struct cb_string {=0D UINT32 tag;=0D UINT32 size;=0D - UINT8 string[0];=0D + UINT8 string[];=0D };=0D =0D #define CB_TAG_SERIAL 0x000f=0D @@ -239,7 +239,7 @@ struct cb_vdat { struct cbmem_console {=0D UINT32 size;=0D UINT32 cursor;=0D - UINT8 body[0];=0D + UINT8 body[];=0D } __attribute__ ((packed));=0D =0D #define CB_TAG_MRC_CACHE 0x0018=0D diff --git a/UefiPayloadPkg/Include/Guid/MemoryMapInfoGuid.h b/UefiPayloadP= kg/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;=0D UINT8 Reserved0[3];=0D UINT32 Count;=0D - MEMORY_MAP_ENTRY Entry[0];=0D + MEMORY_MAP_ENTRY Entry[];=0D } MEMORY_MAP_INFO;=0D #pragma pack()=0D =0D diff --git a/UefiPayloadPkg/Include/Guid/PayloadCommandLine.h b/UefiPayload= Pkg/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 {=0D UNIVERSAL_PAYLOAD_GENERIC_HEADER Header;=0D UINT32 Count;=0D - CHAR8 CommandLine[0];=0D + CHAR8 CommandLine[];=0D } UNIVERSAL_PAYLOAD_COMMAND_LINE;=0D =0D #pragma pack()=0D diff --git a/UefiPayloadPkg/Include/Guid/SmmRegisterInfoGuid.h b/UefiPayloa= dPkg/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;=0D UINT16 Reserved;=0D UINT32 Count;=0D - PLD_GENERIC_REGISTER Registers[0];=0D + PLD_GENERIC_REGISTER Registers[];=0D } PLD_SMM_REGISTERS;=0D =0D #pragma pack()=0D diff --git a/UefiPayloadPkg/Include/Guid/SmmS3CommunicationInfoGuid.h b/Uef= iPayloadPkg/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;=0D UINT16 Reserved;=0D UINT32 CpuCount;=0D - CPU_SMMBASE SmmBase[0];=0D + CPU_SMMBASE SmmBase[];=0D } SMM_S3_INFO;=0D =0D //=0D --=20 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] -=-=-=-=-=-=-=-=-=-=-=-