From: Simon Marchi <simark@simark.ca>
To: Tsukasa OI <research_trasio@irq.a4lg.com>,
Pedro Alves <pedro@palves.net>,
Joel Brobecker <brobecker@adacore.com>,
Enze Li <lienze@sourceware.org>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v3] gdb/unittests: PR28413, suppress warnings generated by Gnulib
Date: Mon, 14 Nov 2022 09:02:46 -0500 [thread overview]
Message-ID: <c3f7edf8-dd6d-6d2d-4451-f5d08970f08e@simark.ca> (raw)
In-Reply-To: <93b29e438526cd93b260339a0dd567a0ca04ed87.1666113056.git.research_trasio@irq.a4lg.com>
On 10/18/22 13:11, Tsukasa OI via Gdb-patches wrote:
> Gnulib generates a warning if the system version of certain functions
> are used (to redirect the developer to use Gnulib version). It caused a
> compiler error when...
>
> - Compiled with Clang
> - -Werror is specified (by default)
> - C++ standard used by Clang is before C++17 (by default as of 15.0.0)
> when this unit test is activated.
>
> This issue is raised as PR28413.
>
> However, previous proposal to fix this issue (a "fix" to Gnulib):
> <https://lists.gnu.org/archive/html/bug-gnulib/2021-10/msg00003.html>
> was rejected because it ruins the intent of Gnulib warnings.
>
> So, we need a Binutils/GDB-side solution.
>
> This commit tries to address this issue on the GDB side. We have
> "include/diagnostics.h" to disable certain warnings only when necessary.
>
> This commit suppresses the Gnulib warnings by surrounding entire #include
> block with DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS to disable Gnulib-
> generated warnings on all standard C++ header files.
> ---
> gdb/unittests/string_view-selftests.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/gdb/unittests/string_view-selftests.c b/gdb/unittests/string_view-selftests.c
> index 2d7261d18d3..441d533b54e 100644
> --- a/gdb/unittests/string_view-selftests.c
> +++ b/gdb/unittests/string_view-selftests.c
> @@ -23,6 +23,11 @@
>
> #define GNULIB_NAMESPACE gnulib
>
> +#include "diagnostics.h"
> +
> +DIAGNOSTIC_PUSH
> +DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS
> +
> #include "defs.h"
> #include "gdbsupport/selftest.h"
> #include "gdbsupport/gdb_string_view.h"
> @@ -34,6 +39,8 @@
> #include <fstream>
> #include <iostream>
>
> +DIAGNOSTIC_POP
> +
> /* libstdc++'s testsuite uses VERIFY. */
> #define VERIFY SELF_CHECK
>
>
> base-commit: 04ea6b63141c43d9e96999e16917358088556fdd
Woops, I merged the v2 version of this patch. But I think it's the same
code.
Simon
prev parent reply other threads:[~2022-11-14 14:02 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 3:10 [PATCH 0/4] gdb: (includes PR28413), Suppress some general warnings if built with Clang Tsukasa OI
2022-09-15 3:10 ` [PATCH 1/4] include: Add macro to ignore -Wuser-defined-warnings Tsukasa OI
2022-09-20 16:36 ` Nick Clifton
2022-09-22 13:02 ` Enze Li
2022-09-15 3:10 ` [PATCH 2/4] include: Add macro to ignore -Wunused-but-set-variable Tsukasa OI
2022-09-15 3:10 ` [PATCH 3/4] gdb/unittests: PR28413, suppress warnings generated by Gnulib Tsukasa OI
2022-09-15 3:10 ` [PATCH 4/4] gdb: Suppress "unused" variable warning on Clang Tsukasa OI
2022-09-22 8:25 ` [PATCH v2 0/4] gdb: (includes PR28413), Suppress some general warnings if built with Clang Tsukasa OI
2022-09-22 8:25 ` [PATCH v2 1/4] include: Add macro to ignore -Wuser-defined-warnings Tsukasa OI
2022-09-22 11:26 ` Nick Clifton
2022-09-22 8:25 ` [PATCH v2 2/4] include: Add macro to ignore -Wunused-but-set-variable Tsukasa OI
2022-09-22 11:27 ` Nick Clifton
2022-09-22 8:25 ` [PATCH v2 3/4] gdb/unittests: PR28413, suppress warnings generated by Gnulib Tsukasa OI
2022-10-18 13:44 ` Enze Li
2022-10-18 16:14 ` Tsukasa OI
2022-09-22 8:25 ` [PATCH v2 4/4] gdb: Suppress "unused" variable warning on Clang Tsukasa OI
2022-10-12 17:36 ` Simon Marchi
2022-10-16 13:37 ` Tsukasa OI
2022-10-17 12:35 ` Simon Marchi
2022-10-18 17:11 ` [PATCH v3] gdb/unittests: PR28413, suppress warnings generated by Gnulib Tsukasa OI
2022-11-14 14:02 ` Simon Marchi [this message]
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=c3f7edf8-dd6d-6d2d-4451-f5d08970f08e@simark.ca \
--to=simark@simark.ca \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=lienze@sourceware.org \
--cc=pedro@palves.net \
--cc=research_trasio@irq.a4lg.com \
/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).