From patchwork Fri Apr 12 17:51:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 88445 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9733C3861021 for ; Fri, 12 Apr 2024 17:53:12 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id AD16B384AB75 for ; Fri, 12 Apr 2024 17:52:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AD16B384AB75 Authentication-Results: sourceware.org; dmarc=fail (p=none dis=none) header.from=efficios.com Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=efficios.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org AD16B384AB75 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712944327; cv=none; b=NcIZz4BGBh0aDJxQYfmg3ByZ6iD+0BTt2RlgWZcBHnBv18McYNW9dmUkbdvYysMQvFsbHd6+7pRRN3bBRo11VXyQjZvI2tU5OdIQy5JdruCaKF5VyqANBauu+v6zluN6PqguepHFel/ST8vtpsEBJUo1Ab8aQ2PTkuzq8OjBgX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712944327; c=relaxed/simple; bh=++RHp5lUgSpDLKvex+ckoHb8lQ0baLGQVSVwaufJwU0=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=URwG6GJjdTP/Doyjex9vSAz1B0AF5gG+usXWAuwhiGUU9Hz6fjfO4LJvDoIYwaZOokP3iVtLiWbpNlcuQ3QGvzy3FoQ29XpcxOot4qd6m+gWFGnNNJSAPrAxebvIAig0MTgHAUWBAlR+1nqzBoiG96Sig3NLe4ED7T+1uTDBHNE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smarchi-efficios.internal.efficios.com (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 1D4EC1E030; Fri, 12 Apr 2024 13:52:00 -0400 (EDT) From: Simon Marchi To: gdb-patches@sourceware.org Cc: Simon Marchi Subject: [PATCH] gdbsupport, gdbserver, gdb: use -Wno-vla-cxx-extension Date: Fri, 12 Apr 2024 13:51:54 -0400 Message-ID: <20240412175200.829114-1-simon.marchi@efficios.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 X-Spam-Status: No, score=-3496.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org When building with clang 18, I see: CXX aarch64-linux-tdep.o /home/smarchi/src/binutils-gdb/gdb/aarch64-linux-tdep.c:1299:26: error: variable length arrays in C++ are a Clang extension [-Werror,-Wvla-cxx-extension] 1299 | gdb_byte za_zeroed[za_bytes]; | ^~~~~~~~ /home/smarchi/src/binutils-gdb/gdb/aarch64-linux-tdep.c:1299:26: note: read of non-const variable 'za_bytes' is not allowed in a constant expression /home/smarchi/src/binutils-gdb/gdb/aarch64-linux-tdep.c:1282:10: note: declared here 1282 | size_t za_bytes = std::pow (sve_vl_from_vg (svg), 2); | ^ Since we are using VLAs right now, that warning doesn't make sense for us. add `-Wno-vla-cxx-extension` to the list of warning flags we try to enable. If we ever choose to disallow VLAs, we can remove that flag. Change-Id: Ie41feafc50c343f6e75333d4f836ce32fbeb6d8c --- gdb/configure | 1 + gdbserver/configure | 1 + gdbsupport/configure | 1 + gdbsupport/warning.m4 | 1 + 4 files changed, 4 insertions(+) base-commit: ec48903170926f3827144525b50ddd3c6ae3fbf0 diff --git a/gdb/configure b/gdb/configure index a77e3e273328..c3d5cf7ed63d 100755 --- a/gdb/configure +++ b/gdb/configure @@ -31179,6 +31179,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wredundant-move \ -Wmissing-declarations \ -Wstrict-null-sentinel \ +-Wno-vla-cxx-extension \ " # The -Wmissing-prototypes flag will be accepted by GCC, but results diff --git a/gdbserver/configure b/gdbserver/configure index b85db9cd49df..026d250cc732 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -13706,6 +13706,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wredundant-move \ -Wmissing-declarations \ -Wstrict-null-sentinel \ +-Wno-vla-cxx-extension \ " # The -Wmissing-prototypes flag will be accepted by GCC, but results diff --git a/gdbsupport/configure b/gdbsupport/configure index b45f12de45be..ae991250ce4c 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -14179,6 +14179,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wredundant-move \ -Wmissing-declarations \ -Wstrict-null-sentinel \ +-Wno-vla-cxx-extension \ " # The -Wmissing-prototypes flag will be accepted by GCC, but results diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4 index bdac8b3e7d22..d12bccbd3fb9 100644 --- a/gdbsupport/warning.m4 +++ b/gdbsupport/warning.m4 @@ -52,6 +52,7 @@ build_warnings="-Wall -Wpointer-arith \ -Wredundant-move \ -Wmissing-declarations \ -Wstrict-null-sentinel \ +-Wno-vla-cxx-extension \ " # The -Wmissing-prototypes flag will be accepted by GCC, but results