diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2024-04-12 13:51:54 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2024-04-17 10:49:32 -0400 |
commit | cbb97c5be367123a00846d4dacb6a042fff87901 (patch) | |
tree | 93bf7b474fb77fb86468ad795bfe395a5c8c1bb0 | |
parent | 1992aeb29ee6f14b0db3801538363ca606a9e687 (diff) | |
download | gdb-cbb97c5be367123a00846d4dacb6a042fff87901.zip gdb-cbb97c5be367123a00846d4dacb6a042fff87901.tar.gz gdb-cbb97c5be367123a00846d4dacb6a042fff87901.tar.bz2 |
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
-rwxr-xr-x | gdb/configure | 1 | ||||
-rwxr-xr-x | gdbserver/configure | 1 | ||||
-rwxr-xr-x | gdbsupport/configure | 1 | ||||
-rw-r--r-- | gdbsupport/warning.m4 | 1 |
4 files changed, 4 insertions, 0 deletions
diff --git a/gdb/configure b/gdb/configure index a77e3e2..c3d5cf7 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 b85db9c..026d250 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 b45f12d..ae99125 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 bdac8b3..d12bccb 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 |