public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdbsupport, gdbserver, gdb: use -Wno-vla-cxx-extension
@ 2024-04-17 14:50 Simon Marchi
0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2024-04-17 14:50 UTC (permalink / raw)
To: gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=cbb97c5be367123a00846d4dacb6a042fff87901
commit cbb97c5be367123a00846d4dacb6a042fff87901
Author: Simon Marchi <simon.marchi@efficios.com>
Date: Fri Apr 12 13:51:54 2024 -0400
gdbsupport, gdbserver, gdb: use -Wno-vla-cxx-extension
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
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="-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 b85db9cd49d..026d250cc73 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 b45f12de45b..ae991250ce4 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 bdac8b3e7d2..d12bccbd3fb 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-17 14:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-17 14:50 [binutils-gdb] gdbsupport, gdbserver, gdb: use -Wno-vla-cxx-extension Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).