public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Fix unused warning for new variable
Date: Fri, 30 Jun 2023 15:29:57 +0100	[thread overview]
Message-ID: <20230630143017.728971-1-jwakely@redhat.com> (raw)

Tested powerpc64le-linux and x86_64-linux. Pushed to trunk.

-- >8 --

This newly-introduced variable isn't used on all paths, so add the
[[maybe_unused]] attribute.

libstdc++-v3/ChangeLog:

	* src/c++11/random.cc (random_device::_M_init): Add maybe_unused
	attribute.
---
 libstdc++-v3/src/c++11/random.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libstdc++-v3/src/c++11/random.cc b/libstdc++-v3/src/c++11/random.cc
index cece6edbfc7..75989bd3337 100644
--- a/libstdc++-v3/src/c++11/random.cc
+++ b/libstdc++-v3/src/c++11/random.cc
@@ -374,11 +374,11 @@ namespace std _GLIBCXX_VISIBILITY(default)
 				      " unsupported token"));
 
 #if defined ENOSYS
-    const int unsupported = ENOSYS;
+    [[maybe_unused]] const int unsupported = ENOSYS;
 #elif defined ENOTSUP
-    const int unsupported = ENOTSUP;
+    [[maybe_unused]] const int unsupported = ENOTSUP;
 #else
-    const int unsupported = 0;
+    [[maybe_unused]] const int unsupported = 0;
 #endif
     int err = 0;
 
-- 
2.41.0


                 reply	other threads:[~2023-06-30 14:30 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=20230630143017.728971-1-jwakely@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).