public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-2220] libstdc++: Fix unused warning for new variable
@ 2023-06-30 14:29 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2023-06-30 14:29 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:d083c8c808cae2c7acb46117374bb047b4c3afce

commit r14-2220-gd083c8c808cae2c7acb46117374bb047b4c3afce
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Jun 30 15:13:25 2023 +0100

    libstdc++: Fix unused warning for new variable
    
    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.

Diff:
---
 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;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-30 14:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-30 14:29 [gcc r14-2220] libstdc++: Fix unused warning for new variable Jonathan Wakely

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).