-
Notifications
You must be signed in to change notification settings - Fork 389
Silence unused warnings #2320
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
Silence unused warnings #2320
Conversation
|
These were discovered by running Running tests exposes even more unused stuff. That said, this passes all tests still. I have opened martinmoene/lest#82 to handle some warnings which aren't our fault. |
f16b27a to
a3e65a9
Compare
|
All is still good. I will push some more changes related to tests on another PR. |
a3e65a9 to
597213b
Compare
597213b to
b6e034a
Compare
|
Something weird happened with the last rebase, sorry about that. Fixed and tested. |
b6e034a to
7e9d8ce
Compare
|
Missed one. tests == ✨ |
|
It got merged, yippie! Last tagged release was 2023. I don't expect they'll update anytime soon. We just pin the version to the commit hash. Tests are still ok with this. |
4259c9d to
90e5410
Compare
|
lest got a tagged release. No need to pick reference an arbitrary commit anymore. This should be ready for merge now :) |
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.
This is great! We were waiting for [[maybe_unused]] to arrive.
I don't understand the (void) found_kernel_start; - do you? If you do and can explain it we're all good.
| #ifdef PLATFORM_x86_solo5 | ||
| solo5_exec(blob.data(), blob.size()); | ||
| throw std::runtime_error("solo5_exec returned"); | ||
| (void) found_kernel_start; |
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.
I don't understand this code 😅 what does it do
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.
(void) anything; just casts it to nothing. It's an explicit way of marking a variable used without actually doing anything with it at runtime.
I would have added [[maybe_unused]] to it at the top level, but I am not sure if found_kernel_start makes sense on systems other than x86. If new architectures are added, it should be up to them to mark it as irrelevant for the corresponding subsystems.
I added these void-casts under the assumption that the previous code here actually is correct in ignoring it. That could be wrong.
This PR silences several benign warnings related to unused variables and parameters, and fixes a misuse of
assert()in vmbuild.There are still two cases of unused parameters/variables:
Both of these are bugs (if not, this must be documented!), and not the compiler being wrong. I have added proper
TODO:andFIXME:label to them.