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

treewide: Address some warnings #16990

Merged
merged 8 commits into from
Mar 11, 2024
Merged

Conversation

BenPope
Copy link
Member

@BenPope BenPope commented Mar 10, 2024

Spotted with Clang 18

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

`error: exception of type 'const ss::sleep_aborted &' will be caught by earlier handler [-Werror,-Wexceptions]`

```c++
class sleep_aborted : public abort_requested_exception {
```

Signed-off-by: Ben Pope <ben@redpanda.com>
`error: implicit capture of 'this' with a capture default of '=' is deprecated`

Signed-off-by: Ben Pope <ben@redpanda.com>
Signed-off-by: Ben Pope <ben@redpanda.com>
Signed-off-by: Ben Pope <ben@redpanda.com>
Signed-off-by: Ben Pope <ben@redpanda.com>
Signed-off-by: Ben Pope <ben@redpanda.com>
Signed-off-by: Ben Pope <ben@redpanda.com>
Signed-off-by: Ben Pope <ben@redpanda.com>
@BenPope BenPope self-assigned this Mar 10, 2024
Copy link
Member

@oleiman oleiman left a comment

Choose a reason for hiding this comment

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

🔥

@@ -129,7 +129,7 @@ seastar::future<> io_queue_workload_generator::generate_writes() {
}

seastar::future<> io_queue_workload_generator::generate_reads() {
return seastar::async([=] {
return seastar::async([this] {
Copy link
Member

Choose a reason for hiding this comment

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

implicit capture of 'this' with a capture default of '=' is deprecated`

🎉

@@ -240,7 +240,7 @@ ss::future<> connection_cache::apply_changes(
}

ss::future<> connection_cache::remove_broker_client_coordinator(
model::node_id self, model::node_id dest) {
Copy link
Member

Choose a reason for hiding this comment

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

Any idea why this wasn't raising a warning on the previous compiler version? I feel like I see these get tripped all the time during development. Maybe it's always clang-tidy.

Copy link
Member Author

@BenPope BenPope Mar 11, 2024

Choose a reason for hiding this comment

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

Any idea why this wasn't raising a warning on the previous compiler version? I feel like I see these get tripped all the time during development. Maybe it's always clang-tidy.

I don't know, we have -Wall -Wextra -Werror, it's been in -Wextra since before clang-16, I can't find a change.

auto key = api_key{i};
auto key = api_key(i);
Copy link
Member

Choose a reason for hiding this comment

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

question: why prefer this change over a static cast?

Copy link
Member Author

Choose a reason for hiding this comment

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

question: why prefer this change over a static cast?

Because I was being lazy, but it's a fair point.

@BenPope BenPope merged commit 1ea15d7 into redpanda-data:dev Mar 11, 2024
17 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