[gcc/devel/omp/gcc-14] libstdc++: Avoid '-Wunused-parameter' for 'nofollow' in static member function 'static std::filesyst
Thomas Schwinge
tschwinge@gcc.gnu.org
Wed Mar 19 09:09:20 GMT 2025
https://gcc.gnu.org/g:ddb0ffb34f769abea55b3f0c9ccc5915defd44ce
commit ddb0ffb34f769abea55b3f0c9ccc5915defd44ce
Author: Thomas Schwinge <tschwinge@baylibre.com>
Date: Wed Feb 19 20:15:30 2025 +0100
libstdc++: Avoid '-Wunused-parameter' for 'nofollow' in static member function 'static std::filesystem::__gnu_posix::DIR* std::filesystem::_Dir_base::openat(const _At_path&, bool)'
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]]'.
(cherry picked from commit 5029c4bd330849fd6513b290d38bce853b320c5b)
Diff:
---
libstdc++-v3/ChangeLog.omp | 6 ++++++
libstdc++-v3/src/filesystem/dir-common.h | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/libstdc++-v3/ChangeLog.omp b/libstdc++-v3/ChangeLog.omp
index 003bb8415da9..447d3c11ddbc 100644
--- a/libstdc++-v3/ChangeLog.omp
+++ b/libstdc++-v3/ChangeLog.omp
@@ -1,5 +1,11 @@
2025-03-19 Thomas Schwinge <tschwinge@baylibre.com>
+ Backported from trunk:
+ 2025-03-06 Thomas Schwinge <tschwinge@baylibre.com>
+
+ * src/filesystem/dir-common.h (openat): Tag 'nofollow' as
+ '[[maybe_unused]]'.
+
Backported from trunk:
2025-03-06 Thomas Schwinge <tschwinge@baylibre.com>
Jonathan Wakely <jwakely@redhat.com>
diff --git a/libstdc++-v3/src/filesystem/dir-common.h b/libstdc++-v3/src/filesystem/dir-common.h
index 95eaf98ed08f..6e42c5687b64 100644
--- a/libstdc++-v3/src/filesystem/dir-common.h
+++ b/libstdc++-v3/src/filesystem/dir-common.h
@@ -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
More information about the Libstdc++-cvs
mailing list