-
Notifications
You must be signed in to change notification settings - Fork 58
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
Remove unused headers #544
base: branch-24.12
Are you sure you want to change the base?
Remove unused headers #544
Conversation
@@ -16,8 +16,6 @@ | |||
#pragma once | |||
|
|||
#include <cstring> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need <stdexcept>
for std::runtime_error
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Done.
@@ -17,11 +17,6 @@ | |||
#include <cassert> | |||
#include <cstddef> | |||
#include <cstring> | |||
#include <iostream> | |||
#include <memory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<memory>
is needed for std::unique_ptr
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The header file remote_handle.hpp
has already included <memory>
for the unique pointers used in the header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, we should include all used headers, regardless of redundancy with what the included headers include themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The headers I removed were reported by the clangd
plug-in that comes with the dev container. The plug-in uses the "include cleaner" to identify the unused include. Given that transitive include is discouraged, and that we do not have misc-include-cleaner
in the .clang-tidy
file, I'll revert the changes.
Edit: I'm still seeing some of the warnings clangd
makes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we aim to avoid relying on transitive header inclusions. If an identifier is used in a file, the corresponding header should be included.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, I am happy to accept partial fixes that improve the state of things. For cleanups like this, it is easy to let work drag on. I prefer to accept improvements as-is even if they don’t fix every instance of a problem. Then future diffs can be smaller and we avoid generating conflicts along the way.
Running |
This PR removes unused headers.