This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/4] environ-selftests: Ignore -Wself-move warning
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>, Sergio Durigan Junior <sergiodj at sergiodj dot net>
- Cc: Simon Marchi <simon dot marchi at ericsson dot com>, gdb-patches at sourceware dot org
- Date: Wed, 21 Jun 2017 22:28:37 +0100
- Subject: Re: [PATCH 1/4] environ-selftests: Ignore -Wself-move warning
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=palves at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 7DA515BEC9
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 7DA515BEC9
- References: <1498076108-29914-1-git-send-email-simon.marchi@ericsson.com> <1498076108-29914-2-git-send-email-simon.marchi@ericsson.com> <87mv91ccey.fsf@sergiodj.net> <884719ed975085085337b2972a9c2ac4@polymtl.ca>
On 06/21/2017 10:05 PM, Simon Marchi wrote:
> Yeah, I didn't expect to have to put the #ifdefs for __clang__ though.
> Without them, gcc emits a warning [-Wunknown-pragma]. We always have
> the option to turn -Wunknown-pragma off globally, what do you prefer?
>
Don't both GCC and Clang understand "#pragma GCC diagnostic" instead?
Or better even, wrap it in some macros (and use _Pragma):
#define DIAGNOSTIC_PUSH _Pragma ("GCC diagnostic push")
#define DIAGNOSTIC_POP _Pragma ("GCC diagnostic pop")
#define DIAGNOSTIC_IGNORE(option) \
_Pragma (STRINGIFY (GCC diagnostic ignored option))
Alternatively, you could replace the std::move with a cast
to rvalue ref, which is just what std::move really is:
-env = std::move (env);
+env = static_cast<gdb_environ &&> (env);
Thanks,
Pedro Alves