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 37F6C941A4A for ; Thu, 24 Aug 2023 14:15:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dWDj+47IdqniF8AlIsyxdb2CPK+bH4zZR1cVdiyt71k=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: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=1692886502; v=1; b=PR2fE7Asq3nO0320WVRrASn3HE8xL855yJS4Q8dRJEep/Vvp+8x3Nav7Vdkt/oE0kwOUbkV/ AZXI7FZZUOLLMWVIAFBP4Mp0qhhGWHnspWG5ADLBf5c6uUcQwAW2dtCi75lZVzhyiCAzOxwoLC2 Nl4EXL4YmFmtoTXtl7T1Za3E= X-Received: by 127.0.0.2 with SMTP id 7TLeYY7687511xSfizLrjX8o; Thu, 24 Aug 2023 07:15:02 -0700 X-Received: from smtp26.services.sfr.fr (smtp26.services.sfr.fr [93.17.128.212]) by mx.groups.io with SMTP id smtpd.web11.4638.1692855763732300697 for ; Wed, 23 Aug 2023 22:42:44 -0700 X-mail-filterd: {"version":"1.7.1","queueID":"4RWX6T5v8Bz1LQKdN","contextId": "39a80781-91c3-4238-8fa9-8a3056b9e3e7"} 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 4RWX6T5v8Bz1LQKdN; Thu, 24 Aug 2023 07:42:41 +0200 (CEST) X-mail-filterd: {"version":"1.7.1","queueID":"4RWX6T4xfHz1LQKdX","contextId": "a068b3a4-e89d-4870-8852-b24661ea62af"} 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 4RWX6T4xfHz1LQKdX; Thu, 24 Aug 2023 07:42:41 +0200 (CEST) From: Elyes Haouas To: devel@edk2.groups.io Cc: Elyes Haouas Subject: [edk2-devel] [PATCH 4/4] UefiPayloadPkg: Use C99 flexible arrays Date: Thu, 24 Aug 2023 07:42:14 +0200 Message-Id: <20230824054214.2839-4-ehaouas@noos.fr> In-Reply-To: <20230824054214.2839-1-ehaouas@noos.fr> References: <20230824054214.2839-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: SOYis5NUxjL2uPrt2xCjfOSMx7686176AA= 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=PR2fE7As; 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 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/UefiPayloadPkg/Include/Coreboot.h b/UefiPayloadPkg/Include/Cor= eboot.h index 2d454f7c89..a53ede390c 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 --=20 2.40.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108006): https://edk2.groups.io/g/devel/message/108006 Mute This Topic: https://groups.io/mt/100935952/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-