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

via lldb-commits lldb-commits at lists.llvm.org
Mon Jul 8 10:30:03 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Keith Smiley (keith)

<details>
<summary>Changes</summary>



---
Full diff: https://github.com/llvm/llvm-project/pull/98055.diff


1 Files Affected:

- (modified) lldb/tools/debugserver/source/PThreadMutex.h (+3-3) 


``````````diff
diff --git a/lldb/tools/debugserver/source/PThreadMutex.h b/lldb/tools/debugserver/source/PThreadMutex.h
index a4535dd79172c2..17f9fdff5f2d3a 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();

``````````

</details>


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


More information about the lldb-commits mailing list