git: 281f1610f178 - stable/15 - contrib/kyua: fix -Wshadow error
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Nov 2026 01:18:50 UTC
The branch stable/15 has been updated by ngie:
URL: https://cgit.FreeBSD.org/src/commit/?id=281f1610f178192bb708083f768d5bf5135a2769
commit 281f1610f178192bb708083f768d5bf5135a2769
Author: Siva Mahadevan <siva@FreeBSD.org>
AuthorDate: 2026-09-05 14:12:11 +0000
Commit: Enji Cooper <ngie@FreeBSD.org>
CommitDate: 2026-11-23 01:17:41 +0000
contrib/kyua: fix -Wshadow error
This fixes the build with gcc 14:
/usr/src/contrib/kyua/engine/prepare/prepare_all.cpp:56:16: error: declaration of 'handler' shadows a member of 'engine::prepare::prepare_all' [-Werror=shadow]
56 | for (auto& handler : prepare::handlers()) {
| ^~~~~~~
In file included from /usr/src/contrib/kyua/engine/prepare/prepare_all.hpp:35,
from /usr/src/contrib/kyua/engine/prepare/prepare_all.cpp:29:
/usr/src/contrib/kyua/engine/prepare/prepare.hpp:51:15: note: shadowed declaration is here
51 | class handler {
| ^
Fixes: edb230c4af499203d7a6894b3711fe6574b26040
Reviewed by: igoro, rlibby, ngie
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D59346
(cherry picked from commit a73bb621ca361edc678bbf49f3ca1acca8aa0344)
---
contrib/kyua/engine/prepare/prepare_all.cpp | 6 +++---
contrib/kyua/os/freebsd/main.cpp | 3 ---
2 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/contrib/kyua/engine/prepare/prepare_all.cpp b/contrib/kyua/engine/prepare/prepare_all.cpp
index db8ea330a51e..73591ef5822a 100644
--- a/contrib/kyua/engine/prepare/prepare_all.cpp
+++ b/contrib/kyua/engine/prepare/prepare_all.cpp
@@ -53,11 +53,11 @@ prepare::prepare_all::exec(cmdline::ui* ui,
const cmdline::parsed_cmdline& cmdline,
const config::tree& user_config) const
{
- for (auto& handler : prepare::handlers()) {
- if (handler->name() == this->name())
+ for (auto& h : prepare::handlers()) {
+ if (h->name() == this->name())
continue;
- int error = handler->exec(ui, cmdline, user_config);
+ int error = h->exec(ui, cmdline, user_config);
if (error != EXIT_SUCCESS)
return error;
}
diff --git a/contrib/kyua/os/freebsd/main.cpp b/contrib/kyua/os/freebsd/main.cpp
index 57e5cc8e8d97..1fe4fca8cae4 100644
--- a/contrib/kyua/os/freebsd/main.cpp
+++ b/contrib/kyua/os/freebsd/main.cpp
@@ -63,9 +63,6 @@ freebsd::main(const int, const char* const* const)
prepare::register_handler(
std::make_shared<freebsd::prepare_kmods>());
-
- prepare::register_handler(
- std::shared_ptr< prepare::handler >(new freebsd::prepare_kmods()));
#endif
return 0;