]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix unused warning for new variable
authorJonathan Wakely <jwakely@redhat.com>
Fri, 30 Jun 2023 14:13:25 +0000 (15:13 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 30 Jun 2023 14:29:51 +0000 (15:29 +0100)
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

index cece6edbfc720124f5646f41b87b58616f91e763..75989bd33375800d04a5ca5788f99c103c199ea2 100644 (file)
@@ -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;