[Lldb-commits] [lldb] [lldb][NFC] Add maybe_unused to err used in asserts (PR #98055)

Keith Smiley via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 8 10:29:36 PDT 2024


https://github.com/keith created https://github.com/llvm/llvm-project/pull/98055

None

>From 6a6fc355e3623a0d0aacc465220a562e103e6dfc Mon Sep 17 00:00:00 2001
From: Keith Smiley <keithbsmiley at gmail.com>
Date: Mon, 8 Jul 2024 10:28:22 -0700
Subject: [PATCH] [lldb][NFC] Add maybe_unused to err used in asserts

---
 lldb/tools/debugserver/source/PThreadMutex.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lldb/tools/debugserver/source/PThreadMutex.h b/lldb/tools/debugserver/source/PThreadMutex.h
index a4535dd79172c..17f9fdff5f2d3 100644
--- a/lldb/tools/debugserver/source/PThreadMutex.h
+++ b/lldb/tools/debugserver/source/PThreadMutex.h
@@ -78,13 +78,13 @@ class PThreadMutex {
   };
 
   PThreadMutex() {
-    int err;
+    [[maybe_unused]] int err;
     err = ::pthread_mutex_init(&m_mutex, NULL);
     assert(err == 0);
   }
 
   PThreadMutex(int type) {
-    int err;
+    [[maybe_unused]] int err;
     ::pthread_mutexattr_t attr;
     err = ::pthread_mutexattr_init(&attr);
     assert(err == 0);
@@ -97,7 +97,7 @@ class PThreadMutex {
   }
 
   ~PThreadMutex() {
-    int err;
+    [[maybe_unused]] int err;
     err = ::pthread_mutex_destroy(&m_mutex);
     if (err != 0) {
       err = Unlock();



More information about the lldb-commits mailing list