From: Simon Marchi via Gdb-patches <gdb-patches@sourceware.org>
To: Tom de Vries <tdevries@suse.de>,
Simon Marchi <simon.marchi@efficios.com>,
gdb-patches@sourceware.org, binutils@sourceware.org
Subject: Re: [PATCH 2/2] include, gdb: fix -Wswitch build errors with gcc 4.8
Date: Wed, 1 Dec 2021 21:45:44 -0500 [thread overview]
Message-ID: <30890d40-e70f-a1c9-5015-9064a4b6067c@polymtl.ca> (raw)
In-Reply-To: <2278406c-c8cd-abf5-a0e5-69e367e3c385@suse.de>
> It looks a bit funny to do the push unconditionally, and the pop
> conditionally.
Hmm that was a mistake.
> Is this not better fixed at the def site, once, rather than at two use
> sites? How about this instead:
> ...
> diff --git a/include/diagnostics.h b/include/diagnostics.h
> index 5ab43a85e9c..43f0458bd8c 100644
> --- a/include/diagnostics.h
> +++ b/include/diagnostics.h
> @@ -79,8 +79,10 @@
> # define DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL \
> DIAGNOSTIC_IGNORE ("-Wformat-nonliteral")
>
> +#if __GNUC__ >= 5
> # define DIAGNOSTIC_ERROR_SWITCH \
> DIAGNOSTIC_ERROR ("-Wswitch")
> +#endif
Yeah, that makes sense, all call sites will end up with this.
Done in v2.
Simon
next prev parent reply other threads:[~2021-12-02 2:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-23 21:14 [PATCH 1/2] gdb: replace pragmas with DIAGNOSTIC macros Simon Marchi via Gdb-patches
2021-11-23 21:14 ` [PATCH 2/2] include, gdb: fix -Wswitch build errors with gcc 4.8 Simon Marchi via Gdb-patches
2021-12-02 0:25 ` Tom de Vries via Gdb-patches
2021-12-02 2:45 ` Simon Marchi via Gdb-patches [this message]
[not found] ` <ef91c0eb-4faf-225e-0549-38a08d65858b@suse.de>
2021-12-02 1:56 ` [PATCH 1/2] gdb: replace pragmas with DIAGNOSTIC macros Simon Marchi via Gdb-patches
2021-12-02 2:44 ` Simon Marchi via Gdb-patches
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=30890d40-e70f-a1c9-5015-9064a4b6067c@polymtl.ca \
--to=gdb-patches@sourceware.org \
--cc=binutils@sourceware.org \
--cc=simon.marchi@efficios.com \
--cc=simon.marchi@polymtl.ca \
--cc=tdevries@suse.de \
/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