From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Fix -Wunused warning
Date: Thu, 17 Dec 2020 14:07:00 +0000 [thread overview]
Message-ID: <20201217140700.GA1196970@redhat.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 282 bytes --]
As noted in PR 66146 comment 35, there is a new warning in the new
std::call_once implementation.
libstdc++-v3/ChangeLog:
* src/c++11/mutex.cc (std::once_flag::_M_finish): Add
maybe_unused attribute to variable used in assertion.
Tested powerpc64le-linux. Committed to trunk.
[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1078 bytes --]
commit 9f9dbc8e09cf48406aa24b6c78735f1a7912cc4e
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Thu Dec 17 13:16:02 2020
libstdc++: Fix -Wunused warning
As noted in PR 66146 comment 35, there is a new warning in the new
std::call_once implementation.
libstdc++-v3/ChangeLog:
* src/c++11/mutex.cc (std::once_flag::_M_finish): Add
maybe_unused attribute to variable used in assertion.
diff --git a/libstdc++-v3/src/c++11/mutex.cc b/libstdc++-v3/src/c++11/mutex.cc
index 4d42bed8ecc..93a5eae391d 100644
--- a/libstdc++-v3/src/c++11/mutex.cc
+++ b/libstdc++-v3/src/c++11/mutex.cc
@@ -74,7 +74,8 @@ std::once_flag::_M_finish(bool returning) noexcept
}
else
{
- int prev = __atomic_exchange_n(&_M_once, newval, __ATOMIC_RELEASE);
+ int prev [[maybe_unused]]
+ = __atomic_exchange_n(&_M_once, newval, __ATOMIC_RELEASE);
__glibcxx_assert(prev & _Bits::_Active);
// Wake any other threads waiting for this execution to finish.
constexpr int futex_wake = 129; // FUTEX_WAKE_PRIVATE
reply other threads:[~2020-12-17 14:07 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=20201217140700.GA1196970@redhat.com \
--to=jwakely@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=libstdc++@gcc.gnu.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).