-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Silence -Wunused-parameter warnings in Unwind-wasm.c #125412
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
Conversation
@llvm/pr-subscribers-libunwind Author: Yuriy Chernyshov (georgthegreat) ChangesFull diff: https://github.com/llvm/llvm-project/pull/125412.diff 1 Files Affected:
diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c
index b18b32c5d17847..fe016b8f5923ad 100644
--- a/libunwind/src/Unwind-wasm.c
+++ b/libunwind/src/Unwind-wasm.c
@@ -102,8 +102,8 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
}
/// Not used in Wasm.
-_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *context,
- uintptr_t value) {}
+_LIBUNWIND_EXPORT void _Unwind_SetIP([[maybe_unused]] struct _Unwind_Context *context,
+ [[maybe_unused]] uintptr_t value) {}
/// Called by personality handler to get LSDA for current frame.
_LIBUNWIND_EXPORT uintptr_t
@@ -116,7 +116,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
/// Not used in Wasm.
_LIBUNWIND_EXPORT uintptr_t
-_Unwind_GetRegionStart(struct _Unwind_Context *context) {
+_Unwind_GetRegionStart([[maybe_unused]] struct _Unwind_Context *context) {
return 0;
}
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
f3f30cc
to
69307d5
Compare
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.
What's your build option?
llvm-project considers this warning low value and llvm/cmake/modules/HandleLLVMOptions.cmake specifies -Wno-unused-parameter.
@MaskRay, we build libunwind using our own build system with the clang default set of warnings enabled. There is already a couple of
|
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.
IMO this is reasonable but it's simpler to drop the parameter names in this case, no need for [[maybe_unused]]
.
Co-authored-by: Louis Dionne <[email protected]>
I applied @ldionne suggestions, I am fine with his approach. |
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.
@ldionne, may we proceed with merging this? |
Sure, but I am not certain why you added some newlines though. Can you leave the formatting as it was? |
749510a
to
c064b57
Compare
I think this is how my clang-format-16 auto-formatted it. |
No description provided.