Skip to content

[lldb][NFC] Add maybe_unused to err used in asserts #98055

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

keith
Copy link
Member

@keith keith commented Jul 8, 2024

No description provided.

@keith keith requested a review from walter-erquinigo July 8, 2024 17:29
@keith keith requested a review from JDevlieghere as a code owner July 8, 2024 17:29
@llvmbot llvmbot added the lldb label Jul 8, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 8, 2024

@llvm/pr-subscribers-lldb

Author: Keith Smiley (keith)

Changes

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

1 Files Affected:

  • (modified) lldb/tools/debugserver/source/PThreadMutex.h (+3-3)
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();

@JDevlieghere JDevlieghere requested a review from jasonmolenda July 8, 2024 18:11
Copy link
Collaborator

@jasonmolenda jasonmolenda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@DavidSpickett DavidSpickett merged commit ae5aebd into llvm:main Jul 9, 2024
8 checks passed
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants