Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

io: clang tidy fixes #17450

Merged
merged 2 commits into from
Mar 28, 2024
Merged

io: clang tidy fixes #17450

merged 2 commits into from
Mar 28, 2024

Conversation

dotnwat
Copy link
Member

@dotnwat dotnwat commented Mar 28, 2024

clang tidy fixes

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v23.3.x
  • v23.2.x

Release Notes

  • none

    /home/nwatkins/src/redpanda-storage-v2/src/v/io/pager.cc:184:17: note: Calling 'operator co_await<void>'
                    co_await waiter.ready.get_future();
                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/nwatkins/src/redpanda-storage-v2/build/release-ci/_deps/seastar-src/include/seastar/core/coroutine.hh:217:5:
    note: Address of stack memory associated with local variable 'f' is still referred to by the stack variable 'waiter' upon returning to the caller.  This will be a dangling reference
        return internal::awaiter<true, T...>(std::move(f));
        ^

Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
Signed-off-by: Noah Watkins <noahwatkins@gmail.com>
@@ -181,7 +181,8 @@ pager::get_page(uint64_t offset) noexcept {
if (page->test_flag(page::flags::faulting)) {
page::waiter waiter;
page->add_waiter(waiter);
co_await waiter.ready.get_future();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't this be one line. I.e,

co_await std::move(waiter.ready.get_future());

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe. i didn't try this one because the temporary should bind to the same thing that the rvalue of std::move would produce and figured clang-tidy would still have a problem with it.

@dotnwat dotnwat merged commit 76449e3 into redpanda-data:dev Mar 28, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants