[libunwind] Silence -Wunused-parameter warnings in Unwind-wasm.c (PR #125412)

Yuriy Chernyshov via cfe-commits cfe-commits at lists.llvm.org
Sat Feb 15 03:43:08 PST 2025


https://github.com/georgthegreat updated https://github.com/llvm/llvm-project/pull/125412

>From 69307d52fc749c847da74e98624ce1c39f2fe2d9 Mon Sep 17 00:00:00 2001
From: Yuriy Chernyshov <thegeorg at yandex-team.com>
Date: Sun, 2 Feb 2025 14:35:53 +0100
Subject: [PATCH 1/3] Silence -Wunused-parameter warnings in Unwind-wasm.c

---
 libunwind/src/Unwind-wasm.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c
index b18b32c5d1784..4b893c8b4f623 100644
--- a/libunwind/src/Unwind-wasm.c
+++ b/libunwind/src/Unwind-wasm.c
@@ -102,8 +102,9 @@ _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 +117,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;
 }
 

>From acf1c4a81c84071e4a5550e85dd2aecfdac323f1 Mon Sep 17 00:00:00 2001
From: Yuriy Chernyshov <thegeorg at yandex-team.com>
Date: Wed, 5 Feb 2025 21:26:24 +0100
Subject: [PATCH 2/3] Apply suggestions from code review

Co-authored-by: Louis Dionne <ldionne.2 at gmail.com>
---
 libunwind/src/Unwind-wasm.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c
index 4b893c8b4f623..caf92eb0dea0f 100644
--- a/libunwind/src/Unwind-wasm.c
+++ b/libunwind/src/Unwind-wasm.c
@@ -103,8 +103,7 @@ _LIBUNWIND_EXPORT uintptr_t _Unwind_GetIP(struct _Unwind_Context *context) {
 
 /// Not used in Wasm.
 _LIBUNWIND_EXPORT void
-_Unwind_SetIP([[maybe_unused]] struct _Unwind_Context *context,
-              [[maybe_unused]] uintptr_t value) {}
+_Unwind_SetIP(struct _Unwind_Context *, uintptr_t) {}
 
 /// Called by personality handler to get LSDA for current frame.
 _LIBUNWIND_EXPORT uintptr_t
@@ -117,7 +116,7 @@ _Unwind_GetLanguageSpecificData(struct _Unwind_Context *context) {
 
 /// Not used in Wasm.
 _LIBUNWIND_EXPORT uintptr_t
-_Unwind_GetRegionStart([[maybe_unused]] struct _Unwind_Context *context) {
+_Unwind_GetRegionStart(struct _Unwind_Context *) {
   return 0;
 }
 

>From 749510a9fd13172f76ea9e574d623f6145249255 Mon Sep 17 00:00:00 2001
From: Yuriy Chernyshov <thegeorg at yandex-team.com>
Date: Sat, 15 Feb 2025 14:42:55 +0300
Subject: [PATCH 3/3] Fix formatting

---
 libunwind/src/Unwind-wasm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libunwind/src/Unwind-wasm.c b/libunwind/src/Unwind-wasm.c
index caf92eb0dea0f..1b97f9763477d 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 *, uintptr_t) {}
+_LIBUNWIND_EXPORT void _Unwind_SetIP(struct _Unwind_Context *,
+                                     uintptr_t) {}
 
 /// Called by personality handler to get LSDA for current frame.
 _LIBUNWIND_EXPORT uintptr_t



More information about the cfe-commits mailing list