[libunwind] Fix -Wformat diagnostic after #190965 (PR #193704)

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 23 03:02:50 PDT 2026


https://github.com/alexfh updated https://github.com/llvm/llvm-project/pull/193704

>From cbba59eb5839303ef9f6be3e9344e357892dc9c6 Mon Sep 17 00:00:00 2001
From: Alexander Kornienko <alexfh at google.com>
Date: Thu, 23 Apr 2026 11:47:49 +0200
Subject: [PATCH 1/3] Fix -Wformat diagnostic after #190965

---
 libunwind/src/CompactUnwinder.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libunwind/src/CompactUnwinder.hpp b/libunwind/src/CompactUnwinder.hpp
index cd2e0e3431314..93a0b6c085294 100644
--- a/libunwind/src/CompactUnwinder.hpp
+++ b/libunwind/src/CompactUnwinder.hpp
@@ -335,7 +335,7 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingRBPFrame(
     default:
       (void)functionStart;
       _LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for "
-                           "function starting at 0x%llX",
+                           "function starting at 0x%" PRIu64 "X",
                             compactEncoding, functionStart);
       _LIBUNWIND_ABORT("invalid compact unwind encoding");
     }
@@ -454,7 +454,7 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingFrameless(
       break;
     default:
       _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "
-                           "function starting at 0x%llX",
+                           "function starting at 0x%" PRIu64 "X",
                             encoding, functionStart);
       _LIBUNWIND_ABORT("invalid compact unwind encoding");
     }

>From a718328e0630ac5772e49d4f8287d24e737000dc Mon Sep 17 00:00:00 2001
From: Alexander Kornienko <alexfh at google.com>
Date: Thu, 23 Apr 2026 11:59:10 +0200
Subject: [PATCH 2/3] Fix formatting

---
 libunwind/src/CompactUnwinder.hpp | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/libunwind/src/CompactUnwinder.hpp b/libunwind/src/CompactUnwinder.hpp
index 93a0b6c085294..b3e3124973f0d 100644
--- a/libunwind/src/CompactUnwinder.hpp
+++ b/libunwind/src/CompactUnwinder.hpp
@@ -334,9 +334,10 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingRBPFrame(
       break;
     default:
       (void)functionStart;
-      _LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for "
-                           "function starting at 0x%" PRIu64 "X",
-                            compactEncoding, functionStart);
+      _LIBUNWIND_DEBUG_LOG(
+          "bad register for RBP frame, encoding=%08X for "
+          "function starting at 0x%" PRIu64 "X",
+          compactEncoding, functionStart);
       _LIBUNWIND_ABORT("invalid compact unwind encoding");
     }
     savedRegisters += 8;
@@ -453,9 +454,10 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingFrameless(
       registers.setRBP(addressSpace.get64(savedRegisters));
       break;
     default:
-      _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "
-                           "function starting at 0x%" PRIu64 "X",
-                            encoding, functionStart);
+      _LIBUNWIND_DEBUG_LOG(
+          "bad register for frameless, encoding=%08X for "
+          "function starting at 0x%" PRIu64 "X",
+          encoding, functionStart);
       _LIBUNWIND_ABORT("invalid compact unwind encoding");
     }
     savedRegisters += 8;

>From 48693d5bcae65ba0305cae990e02302984cdf6ed Mon Sep 17 00:00:00 2001
From: Alexander Kornienko <alexfh at google.com>
Date: Thu, 23 Apr 2026 12:02:40 +0200
Subject: [PATCH 3/3] Another attempt to fix formatting

---
 libunwind/src/CompactUnwinder.hpp | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libunwind/src/CompactUnwinder.hpp b/libunwind/src/CompactUnwinder.hpp
index b3e3124973f0d..c42b7846fb96b 100644
--- a/libunwind/src/CompactUnwinder.hpp
+++ b/libunwind/src/CompactUnwinder.hpp
@@ -334,10 +334,9 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingRBPFrame(
       break;
     default:
       (void)functionStart;
-      _LIBUNWIND_DEBUG_LOG(
-          "bad register for RBP frame, encoding=%08X for "
-          "function starting at 0x%" PRIu64 "X",
-          compactEncoding, functionStart);
+      _LIBUNWIND_DEBUG_LOG("bad register for RBP frame, encoding=%08X for "
+                           "function starting at 0x%" PRIu64 "X",
+                           compactEncoding, functionStart);
       _LIBUNWIND_ABORT("invalid compact unwind encoding");
     }
     savedRegisters += 8;
@@ -454,10 +453,9 @@ int CompactUnwinder_x86_64<A>::stepWithCompactEncodingFrameless(
       registers.setRBP(addressSpace.get64(savedRegisters));
       break;
     default:
-      _LIBUNWIND_DEBUG_LOG(
-          "bad register for frameless, encoding=%08X for "
-          "function starting at 0x%" PRIu64 "X",
-          encoding, functionStart);
+      _LIBUNWIND_DEBUG_LOG("bad register for frameless, encoding=%08X for "
+                           "function starting at 0x%" PRIu64 "X",
+                           encoding, functionStart);
       _LIBUNWIND_ABORT("invalid compact unwind encoding");
     }
     savedRegisters += 8;



More information about the cfe-commits mailing list