From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id 47E0C3858D39; Wed, 17 Apr 2024 14:50:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 47E0C3858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1713365407; bh=TDKgq6fDIH03ocanDVzId02xkksjJfnJsBdVDpBBoq4=; h=From:To:Subject:Date:From; b=ftRt6GzoAksOZBb1vUcehfjBIlPJrtoYSwjv742yMyAjtUDZfz99oopuv5F/KDeJp qlbaTlV5RYnTGznrxOpKX4F2EJ6uPM+8+lDpYI9vLYubZ0pnjWtdZPvFmdglxBxqC3 SoVDaantgeOIM4U8nZrhmNHwRFAuC1jxEM8D11vE= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdbsupport, gdbserver, gdb: use -Wno-vla-cxx-extension X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 1992aeb29ee6f14b0db3801538363ca606a9e687 X-Git-Newrev: cbb97c5be367123a00846d4dacb6a042fff87901 Message-Id: <20240417145007.47E0C3858D39@sourceware.org> Date: Wed, 17 Apr 2024 14:50:07 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dcbb97c5be367= 123a00846d4dacb6a042fff87901 commit cbb97c5be367123a00846d4dacb6a042fff87901 Author: Simon Marchi Date: Fri Apr 12 13:51:54 2024 -0400 gdbsupport, gdbserver, gdb: use -Wno-vla-cxx-extension =20 When building with clang 18, I see: =20 CXX aarch64-linux-tdep.o /home/smarchi/src/binutils-gdb/gdb/aarch64-linux-tdep.c:1299:26: er= ror: 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: no= te: read of non-const variable 'za_bytes' is not allowed in a constant expr= ession /home/smarchi/src/binutils-gdb/gdb/aarch64-linux-tdep.c:1282:10: no= te: declared here 1282 | size_t za_bytes =3D std::pow (sve_vl_from_vg (svg), 2); | ^ =20 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. =20 Change-Id: Ie41feafc50c343f6e75333d4f836ce32fbeb6d8c Diff: --- gdb/configure | 1 + gdbserver/configure | 1 + gdbsupport/configure | 1 + gdbsupport/warning.m4 | 1 + 4 files changed, 4 insertions(+) diff --git a/gdb/configure b/gdb/configure index a77e3e27332..c3d5cf7ed63 100755 --- a/gdb/configure +++ b/gdb/configure @@ -31179,6 +31179,7 @@ build_warnings=3D"-Wall -Wpointer-arith \ -Wredundant-move \ -Wmissing-declarations \ -Wstrict-null-sentinel \ +-Wno-vla-cxx-extension \ " =20 # The -Wmissing-prototypes flag will be accepted by GCC, but results diff --git a/gdbserver/configure b/gdbserver/configure index b85db9cd49d..026d250cc73 100755 --- a/gdbserver/configure +++ b/gdbserver/configure @@ -13706,6 +13706,7 @@ build_warnings=3D"-Wall -Wpointer-arith \ -Wredundant-move \ -Wmissing-declarations \ -Wstrict-null-sentinel \ +-Wno-vla-cxx-extension \ " =20 # The -Wmissing-prototypes flag will be accepted by GCC, but results diff --git a/gdbsupport/configure b/gdbsupport/configure index b45f12de45b..ae991250ce4 100755 --- a/gdbsupport/configure +++ b/gdbsupport/configure @@ -14179,6 +14179,7 @@ build_warnings=3D"-Wall -Wpointer-arith \ -Wredundant-move \ -Wmissing-declarations \ -Wstrict-null-sentinel \ +-Wno-vla-cxx-extension \ " =20 # The -Wmissing-prototypes flag will be accepted by GCC, but results diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4 index bdac8b3e7d2..d12bccbd3fb 100644 --- a/gdbsupport/warning.m4 +++ b/gdbsupport/warning.m4 @@ -52,6 +52,7 @@ build_warnings=3D"-Wall -Wpointer-arith \ -Wredundant-move \ -Wmissing-declarations \ -Wstrict-null-sentinel \ +-Wno-vla-cxx-extension \ " =20 # The -Wmissing-prototypes flag will be accepted by GCC, but results