From: Jonathan Wakely Date: Fri, 30 Jun 2023 14:13:25 +0000 (+0100) Subject: libstdc++: Fix unused warning for new variable X-Git-Tag: basepoints/gcc-15~7919 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d083c8c808cae2c7acb46117374bb047b4c3afce;p=thirdparty%2Fgcc.git 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 --git a/libstdc++-v3/src/c++11/random.cc b/libstdc++-v3/src/c++11/random.cc index cece6edbfc72..75989bd33375 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;