From: Jonathan Wakely <jwakely@redhat.com>
To: Patrick Palka <ppalka@redhat.com>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Squelch -Wparentheses warning with debug iterators
Date: Tue, 13 Sep 2022 11:47:17 +0100 [thread overview]
Message-ID: <CACb0b4nJq0+HWaXiqcN1hrCUwMb0a8QfkLy2f5oGz-9986za+A@mail.gmail.com> (raw)
In-Reply-To: <20220912173907.1766341-1-ppalka@redhat.com>
On Mon, 12 Sept 2022 at 18:40, Patrick Palka via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> I noticed compiling e.g. std/ranges/adaptors/join.cc with
> -D_GLIBCXX_DEBUG -Wsystem-headers -Wall gives the warning:
>
> gcc/libstdc++-v3/include/debug/safe_iterator.h:477:9: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
>
> Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
OK, thanks.
>
> libstdc++-v3/ChangeLog:
>
> * include/debug/safe_iterator.h (_GLIBCXX_DEBUG_VERIFY_OPERANDS):
> Add parentheses to squelch -Wparentheses.
> ---
> libstdc++-v3/include/debug/safe_iterator.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h
> index 33f7a86478a..117dc93de60 100644
> --- a/libstdc++-v3/include/debug/safe_iterator.h
> +++ b/libstdc++-v3/include/debug/safe_iterator.h
> @@ -40,7 +40,7 @@
> #endif
>
> #define _GLIBCXX_DEBUG_VERIFY_OPERANDS(_Lhs, _Rhs, _BadMsgId, _DiffMsgId) \
> - _GLIBCXX_DEBUG_VERIFY(!_Lhs._M_singular() && !_Rhs._M_singular() \
> + _GLIBCXX_DEBUG_VERIFY((!_Lhs._M_singular() && !_Rhs._M_singular()) \
> || (_Lhs._M_value_initialized() \
> && _Rhs._M_value_initialized()), \
> _M_message(_BadMsgId) \
> --
> 2.37.3.542.gdd3f6c4cae
>
prev parent reply other threads:[~2022-09-13 10:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-12 17:39 Patrick Palka
2022-09-13 10:47 ` Jonathan Wakely [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=CACb0b4nJq0+HWaXiqcN1hrCUwMb0a8QfkLy2f5oGz-9986za+A@mail.gmail.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.org \
--cc=ppalka@redhat.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).