From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: Gdb <gdb@sourceware.org>
Subject: Issue with unittest/environ-selftests.c (DIAGNOSTIC_IGNORE_SELF_MOVE)
Date: Sat, 1 Oct 2022 09:01:01 +0200 [thread overview]
Message-ID: <20221001070101.ydc7l3mntlfb7u4z@lug-owl.de> (raw)
[-- Attachment #1: Type: text/plain, Size: 2736 bytes --]
Hi!
I'm mass-building toolchain components and recently got failures all
over GDB when building it with quite recent GCC versions. Turns out
GCC recently got -Wself-move
(0abb78dda084a14b3d955757c6431fff71c263f3), but during unittests, that
is only dealt with when building with clang.
Building is done like this:
.../configure --prefix=/tmp/gdb-m68k-linux --target=m68k-linux
make V=1 all-gdb
/usr/lib/gcc-snapshot/bin/g++ -x c++ -I. -I. -I./config -DLOCALEDIR="\"/tmp/gdb-m68k-linux/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../readline/readline/.. -I./../zlib -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./../gnulib/import -I../gnulib/import -I./.. -I.. -I./../libbacktrace/ -I../libbacktrace/ -DTUI=1 -I./.. -pthread -Wall -Wpointer-arith -Wno-unused -Wunused-value -Wunused-variable -Wunused-function -Wno-switch -Wno-char-subscripts -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable -Wno-sign-compare -Wno-error=maybe-uninitialized -Wno-mismatched-tags -Wsuggest-override -Wimplicit-fallthrough=3 -Wduplicated-cond -Wshadow=local -Wdeprecated-copy -Wdeprecated-copy-dtor -Wredundant-move -Wmissing-declarations -Wstrict-null-sentinel -Wformat -Wformat-nonliteral -Werror -g -O2 -c -o unittests/environ-selftests.o -MT unittests/environ-selftests.o -MMD -MP -MF unittests/.deps/environ-selftests.Tpo unittests/environ-selftests.c
unittests/environ-selftests.c: In function 'void selftests::gdb_environ_tests::test_self_move()':
unittests/environ-selftests.c:228:7: error: moving 'env' of type 'gdb_environ' to itself [-Werror=self-move]
228 | env = std::move (env);
| ~~~~^~~~~~~~~~~~~~~~~
unittests/environ-selftests.c:228:7: note: remove 'std::move' call
cc1plus: all warnings being treated as errors
make[1]: *** [Makefile:1896: unittests/environ-selftests.o] Error 1
make[1]: Leaving directory '/var/lib/laminar/run/gdb-m68k-linux/3/binutils-gdb/gdb'
make: *** [Makefile:13193: all-gdb] Error 2
include:
* diagnostics.h (DIAGNOSTIC_IGNORE_SELF_MOVE): Define for GCC 13+.
diff --git a/include/diagnostics.h b/include/diagnostics.h
index 4161dff6abc..c1a2e8f520c 100644
--- a/include/diagnostics.h
+++ b/include/diagnostics.h
@@ -99,6 +99,10 @@
DIAGNOSTIC_IGNORE ("-Wunused-but-set-variable")
# endif
+# if __GNUC__ >= 13
+# define DIAGNOSTIC_IGNORE_SELF_MOVE DIAGNOSTIC_IGNORE ("-Wself-move")
+# endif
+
/* GCC 4.8's "diagnostic push/pop" seems broken when using this, -Wswitch
remains enabled at the error level even after a pop. Therefore, don't
use it for GCC < 5. */
Ok for HEAD? Or should I send that to the Binutils mailing list?
Thanks,
Jan-Benedict
--
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
reply other threads:[~2022-10-01 7:08 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221001070101.ydc7l3mntlfb7u4z@lug-owl.de \
--to=jbglaw@lug-owl.de \
--cc=gdb@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).