]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Avoid '-Wunused-parameter' for 'nofollow' in static member function 'stati...
authorThomas Schwinge <tschwinge@baylibre.com>
Wed, 19 Feb 2025 19:15:30 +0000 (20:15 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Thu, 6 Mar 2025 13:40:58 +0000 (14:40 +0100)
In a newlib configuration:

    In file included from ../../../../../source-gcc/libstdc++-v3/src/c++17/fs_dir.cc:37,
                     from ../../../../../source-gcc/libstdc++-v3/src/c++17/cow-fs_dir.cc:26:
    ../../../../../source-gcc/libstdc++-v3/src/c++17/../filesystem/dir-common.h: In static member function ‘static std::filesystem::__gnu_posix::DIR* std::filesystem::_Dir_base::openat(const _At_path&, bool)’:
    ../../../../../source-gcc/libstdc++-v3/src/c++17/../filesystem/dir-common.h:210:36: error: unused parameter ‘nofollow’ [-Werror=unused-parameter]
      210 |   openat(const _At_path& atp, bool nofollow)
          |                               ~~~~~^~~~~~~~

libstdc++-v3/
* src/filesystem/dir-common.h (openat): Tag 'nofollow' as
'[[maybe_unused]]'.

libstdc++-v3/src/filesystem/dir-common.h

index 5ff621c3380a834eab68b86f8e7520d30618ded0..c7d4bc4e6ed7bf9f349009700647781fc01ec028 100644 (file)
@@ -207,7 +207,7 @@ struct _Dir_base
   }
 
   static posix::DIR*
-  openat(const _At_path& atp, bool nofollow)
+  openat(const _At_path& atp, [[maybe_unused]] bool nofollow)
   {
 #if _GLIBCXX_HAVE_FDOPENDIR && defined O_RDONLY && defined O_DIRECTORY \
     && ! _GLIBCXX_FILESYSTEM_IS_WINDOWS