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 D6F64AC0BF0 for ; Fri, 5 Apr 2024 06:43:29 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=d6T+WqWiZW2+EWLhNvfkz4g2N/AklUgEyhmvH5GoNCw=; c=relaxed/simple; d=groups.io; h=Received-SPF:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:nodisclaimer:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1712299408; v=1; b=VJkiIiWi1eOFZ9ywmbREw3B4c46OkmCn2o7eX6d+9VfmProDOGznyGUjl/BLIimopDEJ43sR Tr7OEgyBkCs8rYZ018+ES/CEKrspvZh6nIv9537kgxLUKMv4Y2Sen17B2Qbj5XlJoJTFtC5gYqR wLN5TWdD83MCmfw1YJa+k/kMkUeltfK1WL35W1NgwLRjMyG/PDahpsnX4lPS2XbEbQ9/XcWSWeB 2HloxmQdKs6rzReV3A0aBZd4kmfig/YnnyqQmk6Cr47UPVg9pvPTCmz4h8wdifaHQLA2t/kdUiQ 9CG4k9ssQ8xd4ngQuxar2YUz9OruEFmfKQaeAjycUvnVg== X-Received: by 127.0.0.2 with SMTP id ByhgYY7687511xDwHChTRdz3; Thu, 04 Apr 2024 23:43:28 -0700 X-Received: from EUR02-VI1-obe.outbound.protection.outlook.com (EUR02-VI1-obe.outbound.protection.outlook.com [40.107.241.81]) by mx.groups.io with SMTP id smtpd.web10.5317.1712299406917135189 for ; Thu, 04 Apr 2024 23:43:27 -0700 X-Received: from DB8P191CA0027.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::37) by GVXPR08MB10639.eurprd08.prod.outlook.com (2603:10a6:150:14d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Fri, 5 Apr 2024 06:43:22 +0000 X-Received: from DU6PEPF0000A7DF.eurprd02.prod.outlook.com (2603:10a6:10:130:cafe::1c) by DB8P191CA0027.outlook.office365.com (2603:10a6:10:130::37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.28 via Frontend Transport; Fri, 5 Apr 2024 06:43:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C X-Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DU6PEPF0000A7DF.mail.protection.outlook.com (10.167.8.36) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Fri, 5 Apr 2024 06:43:22 +0000 X-Received: ("Tessian outbound 1b0f2681ce6f:v300"); Fri, 05 Apr 2024 06:43:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: bce30573da73dc01 X-CR-MTA-TID: 64aa7808 X-Received: from 5089339653fd.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id C7102C68-B7CE-42C1-B03A-5E6FC9458DE5.1; Fri, 05 Apr 2024 06:43:11 +0000 X-Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5089339653fd.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Fri, 05 Apr 2024 06:43:11 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com (2603:10a6:208:148::12) by DB9PR08MB7493.eurprd08.prod.outlook.com (2603:10a6:10:36e::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Fri, 5 Apr 2024 06:43:08 +0000 X-Received: from AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::4a5d:48:bf49:a524]) by AM0PR08MB4289.eurprd08.prod.outlook.com ([fe80::4a5d:48:bf49:a524%7]) with mapi id 15.20.7409.042; Fri, 5 Apr 2024 06:43:07 +0000 From: "levi.yun" To: "Kinney, Michael D" , "devel@edk2.groups.io" CC: nd , Sami Mujawar Subject: Re: [edk2-devel] [Question] using Flexible Array Member in Structure. Thread-Topic: [edk2-devel] [Question] using Flexible Array Member in Structure. Thread-Index: AQHahakc/TiIwaueUUe/jJBXJwE0SLFWuYMAgAKDebo= Date: Fri, 5 Apr 2024 06:43:07 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: x-ms-traffictypediagnostic: AM0PR08MB4289:EE_|DB9PR08MB7493:EE_|DU6PEPF0000A7DF:EE_|GVXPR08MB10639:EE_ x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: Nv9GFO7i3/i1rslFPOC12iQkVMbn7Wy37qeyk7hSxcQtgyfxlvvTLAeQ3fqqLqo94POQ2jqgLe1guaI5ICr6UkCk/nBUkFuLKjsEZdxS1qOqQmzQZ1ri3vDNzA+Q6CmXWdGkeT8+/cbhYjhcnrYY6bbWTX6AGhTgdNZTucQTzuJ3pRGXQ0EyEbfMzYS3usgxgsGqd4CHOUs/ZdO5vh32tixMfkC+aTX/jz2T5w4Oe9wQ4HGgFdUjQYM3FeG6NexUJd+6WmF7U5zx06z1l+osq4aWZvf5Rm+FhGBXBFchzoHjHcXeqfIvm1OlG6+p1/kAwjq6XbQKqkAFV1LOueCtuBjp+7y81raMJK0Q4ro/gromdEAF/gaCkCY6tRSUFpZMZLvaEja2GFZ9kTHOgQzvdqNFPIOFkeWtt5isDzr98yGncZGChZVBbVr8q5ND3XwIk9rX2KI/PRQdk0/0z/jtafKWMBxlrlkcCH+yjJdcfc24YwvWg79UV7e64DYZvOxQ+z80iXLdNs4jq9/b7CWXXhD6jlVNUgOOruzA/FnGmWkOTsiX3qRClvqmJafzP5Hi6sOF/IfUWvFenuIl0OKvZsgDd0bcl8dcWI691X2Mz54= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM0PR08MB4289.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(1800799015)(366007);DIR:OUT;SFP:1102; MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR08MB7493 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU6PEPF0000A7DF.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f41f508d-4857-4429-286e-08dc553bafed X-Microsoft-Antispam-Message-Info: Y2zK6q26833OiAvMGjyoLp4bIGBPO19z6Qsb0PmI80zrC2JOQxUzLWFZ3HYRAtP8Rf0wOOZIG/WaPE7MYkgAerCSNqKPm0T9APHXzE0WaE8/opiYdCCK4F74gJbiRW3bLL+jX/JA6uNkTCjnA1VEkQOjqil6OHsfX1igX6DE8uz6bYPjDbWhJpAZjUlNkX0riCeh2ZZ6THcWiz58BALRmtgnyD9gW2AY6Ncx/0sDMuMBnRas+3f0el1gl1fFiBYrhmeJVULOcoFq3MH67MXopMsFoN9HVL+VA0D82yDiA2KBQm4748sMblZY+fS3kuwN8b5USLjK3RaZP8fI8LbaSDgvCP2E8q1SkO2YhxbFgagcdCK7ThEY+Js9p+Khc/LjCbX52uuA1+N/9mLdBWu4RtwCBylMa6y9aRqbIfyZhSbTSDiVLUQRXcXHepqPJsPKPGuX8npUNWQcJ4m4ptTGdqIWGVJgsKGjE5GpOsvM6giCyY0tyD+PiNv7Mi8JhbGtQhbQ/CN51iW6XxouEaagRrjo7YQbqaGC4WET7AH9DyTZc+p+OhUmUIxoB4hmQ3vG5eysBhILwsDwKMJA6GdWSE9XoVRzXcqd02fNb3r565mVywvGxjjyxmWTcI4/W2ae61XclgOziE8Ltzpo6WxGeuP1rff7yDtTPtV3NjMpDvfhokzjczjcSmuVRnB0Wa9Sb6z8G2qwVbsriGlum72n2w== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2024 06:43:22.2754 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f41f508d-4857-4429-286e-08dc553bafed X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d;Ip=[63.35.35.123];Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DU6PEPF0000A7DF.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR08MB10639 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 Resent-Date: Thu, 04 Apr 2024 23:43:27 -0700 Resent-From: yeoreum.yun@arm.com Reply-To: devel@edk2.groups.io,yeoreum.yun@arm.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: Jz3aEqhXy6eBSesucNSYKzI0x7686176AA= Content-Language: en-GB Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=VJkiIiWi; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=arm.com (policy=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 Hi Michael! Thanks for answer. > Converting these to a flexible array member would not be a backwards compatible change. That's the point. But at least when I see the compiler used in tool_def.txt= , there's no compiler which doesn't support to flexible array member. Do we still need to consider the case building edk2 with lower version of c= omipler which isn't manifested in tool_def.txt? Thanks! ________________________________________ From: Kinney, Michael D Sent: 03 April 2024 17:17 To: devel@edk2.groups.io; Yeo Reum Yun Cc: nd; Sami Mujawar; Kinney, Michael D Subject: RE: [edk2-devel] [Question] using Flexible Array Member in Structu= re. Yes. Use of flexible array members is supported and encouraged. There are challenges with existing structure definitions that declare arrays of size [1] when a flexible array is really intended. Those were defined before flexible array members were supported by all the compilers. Converting these to a flexible array member would not be a backwards compatible change. Mike > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of > levi.yun > Sent: Wednesday, April 3, 2024 2:27 AM > To: devel@edk2.groups.io > Cc: nd@arm.com; sami.mujawar@arm.com > Subject: [edk2-devel] [Question] using Flexible Array Member in > Structure. > > 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! > > >=20 > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117453): https://edk2.groups.io/g/devel/message/117453 Mute This Topic: https://groups.io/mt/105305209/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-