From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2071.outbound.protection.outlook.com [40.107.7.71]) by sourceware.org (Postfix) with ESMTPS id 1E2773858C50 for ; Thu, 9 Feb 2023 22:52:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1E2773858C50 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IDP3ZEvoegABSV2bUXhy8BYi7FrIMiKudmCiQy3cFOs=; b=eboq28OVwKPKX6qOOV1FmtYrJTbGYuWL8aDHQD3OMYnvwmPw5cZAUkxKI44sx4e2ghXrTzvXe+jv7KHVWBsMlnHQyStB8rx6UjqAvQB+GPOUw10TGr8jN4FpGZi/POhZCfl4QwVcDdq8r7jSGmNV6pdlMrHQB/azIlUaxi6fGvA= Received: from AM6PR0502CA0062.eurprd05.prod.outlook.com (2603:10a6:20b:56::39) by GV2PR08MB8704.eurprd08.prod.outlook.com (2603:10a6:150:b9::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17; Thu, 9 Feb 2023 22:51:56 +0000 Received: from AM7EUR03FT025.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:56:cafe::b5) by AM6PR0502CA0062.outlook.office365.com (2603:10a6:20b:56::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19 via Frontend Transport; Thu, 9 Feb 2023 22:51:56 +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 Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT025.mail.protection.outlook.com (100.127.140.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19 via Frontend Transport; Thu, 9 Feb 2023 22:51:56 +0000 Received: ("Tessian outbound 333ca28169fa:v132"); Thu, 09 Feb 2023 22:51:56 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c2dae99be4a54ebe X-CR-MTA-TID: 64aa7808 Received: from 061c1c8b3fe0.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id ABDA8F77-39E8-4CE2-A42E-84A7D2AB14A0.1; Thu, 09 Feb 2023 22:51:49 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 061c1c8b3fe0.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 09 Feb 2023 22:51:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Pn4PJJL9WnBt52wWoTgJkcanmKtcyE9sX97btaOE6e++RKLwRjAv7hn0R/N7ISA127t++B22vqxgBdi7QUQWafi9uzR/YmBqG3Cg2e79qKoCB2LI5MBKFHGcIX7sDpH/a6kU3FxvqYfR4Z4X3Lxf+UyWSje0mCqfwH2deGxZ4bG3iYhLbSDaYvMRjF3TDWPrKMEWf9QFKVjnjPkSni4hcS9fYfoy6E9I2ERF0HHFBstquqBtRL45TjMb3QBc8HdMyoGU12jup52jxCHjjbBBs222r3WbaA+4atLlq+SWUqxNedjbZvAr+Lzl52CdHmDuYW0dk3z1jHBIfHIG17yGGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IDP3ZEvoegABSV2bUXhy8BYi7FrIMiKudmCiQy3cFOs=; b=QXFq0c7lWRPJHF1tOqCO8VfIRDwT7CE/3NVr9ewVPpICRpBZQVLS2gJOlWin4mlecXOhxEsU6frw7BIv6SDj8V45qhkGpBco4dujgmqlg5qm6ewyP5/WxZ0Xttub+KoU5xH0QHynxY8qpTF7ktfTObk8Tr0xCvaJC9yxpxeJd2YCYGmGp8r/ZNVW6YUZgvmm6Kn46u0mg/SCdXAhxvF+GZLU5mRa9dTLsx2eoBY5ZmGrihSgMpz1aq9Kl0ZD0ZbITCD9FJ4jqELczoncmZRlM3KmYBc+Jn6QHJtJcfzbUviUrG34AJbCYL2GrRFJH1qPU+/R4OxVes6aqxnA7IQ83A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=IDP3ZEvoegABSV2bUXhy8BYi7FrIMiKudmCiQy3cFOs=; b=eboq28OVwKPKX6qOOV1FmtYrJTbGYuWL8aDHQD3OMYnvwmPw5cZAUkxKI44sx4e2ghXrTzvXe+jv7KHVWBsMlnHQyStB8rx6UjqAvQB+GPOUw10TGr8jN4FpGZi/POhZCfl4QwVcDdq8r7jSGmNV6pdlMrHQB/azIlUaxi6fGvA= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by DB5PR08MB10063.eurprd08.prod.outlook.com (2603:10a6:10:48a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Thu, 9 Feb 2023 22:51:47 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::bced:32a3:b77e:90a6%7]) with mapi id 15.20.6086.019; Thu, 9 Feb 2023 22:51:47 +0000 Message-ID: <9b5e49d3-eb08-bb0c-1dad-0ac75606f322@arm.com> Date: Thu, 9 Feb 2023 22:51:41 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [COMMITTED PATCH] [aarch64] Avoid initializers for VLAs To: Roland McGrath , GDB References: Content-Language: en-US From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0041.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:152::10) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|DB5PR08MB10063:EE_|AM7EUR03FT025:EE_|GV2PR08MB8704:EE_ X-MS-Office365-Filtering-Correlation-Id: 161cc372-6b4d-444a-645c-08db0af03eef 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: ADlrbfVwl7N3xpu//HaXOyHKLHj80Dd+73GZEzBkXLf5DAXtDyogqgIuWqysQvL8Pz9RZNKnWdaRNN7RyiXSgl65fcgqlO37bm6tIo72TQatDiu5kx0g91gxfr8ZBGMPTyPRBPA2ivRud1KMh2AHDXqz+y+zPjz03fWpntzvQgdRFC9DaNz6vQ1PSFs3RyenVk/t3lIJmSVor3Uaxi/9f9hm1AkAWRtXEOkIoboCxfgKPS3BsdSTWDRVgSWApq4LbKY8FQVrx8iquYDVX+/+Q9AOOd3KyPg1mY+R6rvdhfQ/KXusQCj5bO+z+sGzNUIraEp7+s31OEfhsq61FL/JG/hg5ex6itjpdmwWeERGC8jfQcH8gTMGMCOBnSO8N7KKOJk+sPysczIxsD1yiGFdCCas7AELvrL2rI/NKMwa3vHkACMhIRtwdWcqbAMumsbl5eCR1A6+El1z7Be9lWgIklhoqQyzGHBBWbnUzevH4jQBkaBQ9Kbn4QQJ0ZSAViAKYK815j/1OISLev9bOMAfn0OJktE2yRvvpmKpz4sJIBkWfwHot5PJU1nTNYtVl/ggxA8DEdjA/D15BsdIqor2paDfarerLG9Ia0VnRSidPOmUCVDllpiYsFcIJxZUVcHuWq6Xjg1jfP8ZMvGgLlnTGad56ohWBSXqqy/rt+uFjT20d4gCdfHIJHVena24TIei9N+p4qCGk3DSwp9wOhMK9/mx+0DVNNKPlWqIpgQtC+k= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR08MB3919.eurprd08.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230025)(4636009)(136003)(376002)(39860400002)(346002)(366004)(396003)(451199018)(2616005)(478600001)(6486002)(5660300002)(8936002)(53546011)(31686004)(6506007)(26005)(186003)(6512007)(6666004)(316002)(8676002)(66556008)(66476007)(66946007)(41300700001)(38100700002)(44832011)(110136005)(31696002)(86362001)(36756003)(2906002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR08MB10063 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 71fb0dae-0c76-450b-00e4-08db0af037c1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MdTGqFzcjHGSdai5wc6o4yYd0+U9QzmG0lhC4IODP1zrxkSuEPPH5MNqJos/KBFVbnBRqbl6xkSy/BbOZ3X3wYQOrf6ulZ3rAcQopp6S3K+uS0+aHkkfovjxuASXA+2t7mUjRwREEz3k98yx0OSVCkotTqki7BXIqEaCaQhlTHFJH8aEuWq1tokz/wPDJpuQMvKF6SD6NraOOUSLs/urRPTUN9L1WCoj/P1Vzk7BBze+Ko0Nzov1PNz6At2u5X0/VZwRV/oBwE6DzBTTorAFzYKiXnadUhK2xuVS5PjH91y3sBzn/CZoubH18ual3/rXpJpv4nccJ6ewVLNodfKKWGZYBpP+HJEYiNewud7dp/0wsGFrby3brQjs8Mf9lRljqNafHQ7nQ0Em1mqW8NqikmJUl0GrWDoEkJ46v/EncgFGR1oOGa8itRsIbvy8NqSp5n5RRwdME7iQFHm71+TCNdVGw0W/9IB09akEK/tf+Zb+LF6aDoCjqL2sm8JvYBu1F/H8unxFwmkIbnhZgR2rjQxw9zpGmsUZRSBn5ppLgHjHdpfOQztZuouP0EDAbyVuz+3FCraEZAUSusLzC+VXlQpdWJSVDP43LLHXbHibPMYmr+RnafCszf9WHA+k1ORSXg7Zn1rE//HBP2k+1cKz6m4/pFH9T1yJiP0+ssmLP5u4IeAfYScvL/my9r4+eM9eTTxFZsHUUv60eSPVLPnzptcrpL2oooTh4jLDT6Ucckc= X-Forefront-Antispam-Report: CIP:63.35.35.123;CTRY:IE;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:64aa7808-outbound-1.mta.getcheckrecipient.com;PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com;CAT:NONE;SFS:(13230025)(4636009)(346002)(136003)(376002)(396003)(39860400002)(451199018)(40470700004)(46966006)(36840700001)(5660300002)(44832011)(40480700001)(40460700003)(31686004)(8936002)(186003)(2906002)(70586007)(41300700001)(36756003)(26005)(70206006)(6512007)(53546011)(2616005)(336012)(6666004)(478600001)(47076005)(6506007)(110136005)(316002)(86362001)(8676002)(31696002)(356005)(82310400005)(36860700001)(82740400003)(81166007)(6486002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 22:51:56.6737 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 161cc372-6b4d-444a-645c-08db0af03eef 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: AM7EUR03FT025.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB8704 X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2/9/23 19:06, Roland McGrath via Gdb-patches wrote: > C99 does not permit initializers for variable length arrays, and Clang > now enforces this. > Committed as obvious enough. Yep. Thanks for patching this up. > > Thanks, > Roland > > commit b695fdd9b2494a64db1fb8e584753a1a5afec494 (HEAD -> master) > Author: Roland McGrath > Date: Thu Feb 9 10:47:17 2023 -0800 > > [aarch64] Avoid initializers for VLAs > > Clang doesn't accept initializer syntax for variable-length > arrays in C. Just use memset instead. > > diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c > index e4158236db2..ecb2eeb9540 100644 > --- a/gdb/aarch64-linux-nat.c > +++ b/gdb/aarch64-linux-nat.c > @@ -56,6 +56,8 @@ > > #include "nat/aarch64-mte-linux-ptrace.h" > > +#include > + > #ifndef TRAP_HWBKPT > #define TRAP_HWBKPT 0x0004 > #endif > @@ -445,7 +447,9 @@ fetch_tlsregs_from_thread (struct regcache *regcache) > gdb_assert (regno != -1); > gdb_assert (tdep->tls_register_count > 0); > > - uint64_t tpidrs[tdep->tls_register_count] = { 0 }; > + uint64_t tpidrs[tdep->tls_register_count]; > + memset(tpidrs, 0, sizeof(tpidrs)); > + > struct iovec iovec; > iovec.iov_base = tpidrs; > iovec.iov_len = sizeof (tpidrs); > @@ -471,7 +475,8 @@ store_tlsregs_to_thread (struct regcache *regcache) > gdb_assert (regno != -1); > gdb_assert (tdep->tls_register_count > 0); > > - uint64_t tpidrs[tdep->tls_register_count] = { 0 }; > + uint64_t tpidrs[tdep->tls_register_count]; > + memset(tpidrs, 0, sizeof(tpidrs)); > > for (int i = 0; i < tdep->tls_register_count; i++) > {