Skip to content

Commit

Permalink
stall_detector: fix unused function warning/error
Browse files Browse the repository at this point in the history
clang unused function detection seems bugged as it complains about
unused functions in an anonymous namespace in a header: pretty weird
since we don't expect everyone who includes a header file to include
_every_ function in it, do we?

Work around it with `[[maybe_unused]]`.
  • Loading branch information
travisdowns committed Feb 20, 2025
1 parent a4b772a commit 1cc7b30
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/unit/stall_detector_test_utilities.hh
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ void spin_some_cooperatively(std::chrono::duration<double> how_much, void_fn bod
}
}

[[maybe_unused]]
future<> spin_some_cooperatively_coro(std::chrono::duration<double> how_much, void_fn body = []{}) {
auto end = std::chrono::steady_clock::now() + how_much;
while (std::chrono::steady_clock::now() < end) {
Expand Down

0 comments on commit 1cc7b30

Please sign in to comment.