From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id q76+B2NE5WNiVy4AWB0awg (envelope-from ) for ; Thu, 09 Feb 2023 14:07:15 -0500 Received: by simark.ca (Postfix, from userid 112) id 0C6AD1E221; Thu, 9 Feb 2023 14:07:15 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=JUWqAwds; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id B05D21E110 for ; Thu, 9 Feb 2023 14:07:14 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 004223858028 for ; Thu, 9 Feb 2023 19:07:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 004223858028 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1675969634; bh=7W9/sWkpL1+7G5pQCm93msUDra3B+1du569rFGYjpG4=; h=Date:Subject:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=JUWqAwdsK4SPl8JRJbmbvZZ3cfPG09C1KZ4/TyWNS4yWnNZom/Ec9rRSizOunORdT W90KoRiS6CN/XyHEfdmakOef3foL1RdLP6qDHIaGhM6cXrx1x+qrHQENkQqRUNtLV3 IsIbo5pGfboMGXpqglpXZEtwoDJ8RpDEFKkGmFH0= Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) by sourceware.org (Postfix) with ESMTPS id A5DD23858C5F for ; Thu, 9 Feb 2023 19:06:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5DD23858C5F Received: by mail-io1-xd33.google.com with SMTP id j17so1056780ioa.9 for ; Thu, 09 Feb 2023 11:06:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7W9/sWkpL1+7G5pQCm93msUDra3B+1du569rFGYjpG4=; b=Tere16pO1PRq/s2LEx5rChlXY9YIZ4w6cnJ3RhAyXrsJlCR4geYMmRw82ueeeLpxLD 3z73aZA4AAfMCobqAauPYTpLqE3ASCFBXerb8GIJQVGdgYLqSjnezU/7vxneGWtb6PXu LC7hpapFVOLJeXnccKByjqxdmH51NOuls2gVdGgK6EJXR10RjGAEEkZyZwizBwlkecCd z8aUK3MSZJdF8PwyM+kEZaDF+Zy8giUD6sOcvcXE9VZfSPqny3/9T0St+gKnxcPhdvdA rxRsGr4OBSVMcUPejbf8xfflEqK43fOGpfDCI04Ys0dlAPj5uU+E8/9780rChnBRsVYL yTIQ== X-Gm-Message-State: AO0yUKVAMaSXl24SxgFhqtGKnkUtwF/0q5xvkcV7Jr+1KBR5dmQD2KHm ch7BSHdWjrv23LJWtmuEdHtRkfcbV2aojuLGG+1jMkXUAzRogFISWO8= X-Google-Smtp-Source: AK7set9FwmBcaazYKfeXF9djvJB9n6To/U7YDAgHnzfH71UhVk68KBtpk2tBuRPUjaQgP3gHdOypWEQsDUZyo53lpeg= X-Received: by 2002:a02:b707:0:b0:38a:4b1f:f69b with SMTP id g7-20020a02b707000000b0038a4b1ff69bmr3349100jam.4.1675969612127; Thu, 09 Feb 2023 11:06:52 -0800 (PST) MIME-Version: 1.0 Date: Thu, 9 Feb 2023 11:06:40 -0800 Message-ID: Subject: [COMMITTED PATCH] [aarch64] Avoid initializers for VLAs To: GDB Content-Type: text/plain; charset="UTF-8" X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Roland McGrath via Gdb-patches Reply-To: Roland McGrath Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" C99 does not permit initializers for variable length arrays, and Clang now enforces this. Committed as obvious enough. 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++) {