]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Use [[maybe_unused]] attribute in src/c++23/print.cc
authorJonathan Wakely <jwakely@redhat.com>
Tue, 23 Jul 2024 09:08:52 +0000 (10:08 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 23 Jul 2024 09:25:36 +0000 (10:25 +0100)
This avoids some warnings when the preprocessor conditions are not met.

libstdc++-v3/ChangeLog:

* src/c++23/print.cc (__open_terminal): Use [[maybe_unused]] on
parameter.

libstdc++-v3/src/c++23/print.cc

index 558dc149d1253d0cd971a4eff87891e50ecad15b..8ba7140596726f7cfe5f561d7fff42f9b6a9fc4a 100644 (file)
@@ -67,7 +67,7 @@ namespace
   // This returns intptr_t that is either a Windows HANDLE
   // or 1 + a POSIX file descriptor. A zero return indicates failure.
   void*
-  __open_terminal(FILE* f)
+  __open_terminal([[maybe_unused]] FILE* f)
   {
 #ifndef _GLIBCXX_USE_STDIO_PURE
     if (f)
@@ -85,7 +85,7 @@ namespace
   }
 
   void*
-  __open_terminal(std::streambuf* sb)
+  __open_terminal([[maybe_unused]] std::streambuf* sb)
   {
 #if ! defined _GLIBCXX_USE_STDIO_PURE && defined __cpp_rtti
     using namespace __gnu_cxx;