[Lldb-commits] [lldb] 5f0080f - [lldb] Fix warnings about unused variables when building without asserts. NFC.

Martin Storsjö via lldb-commits lldb-commits at lists.llvm.org
Mon Aug 29 03:26:46 PDT 2022


Author: Martin Storsjö
Date: 2022-08-29T13:25:38+03:00
New Revision: 5f0080fbe810caae3750d159da62bac04dbd844f

URL: https://github.com/llvm/llvm-project/commit/5f0080fbe810caae3750d159da62bac04dbd844f
DIFF: https://github.com/llvm/llvm-project/commit/5f0080fbe810caae3750d159da62bac04dbd844f.diff

LOG: [lldb] Fix warnings about unused variables when building without asserts. NFC.

Added: 
    

Modified: 
    lldb/include/lldb/Utility/SharedCluster.h
    lldb/source/Host/windows/MainLoopWindows.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/include/lldb/Utility/SharedCluster.h b/lldb/include/lldb/Utility/SharedCluster.h
index 9f7aa92420ed0..2992e6c9beec5 100644
--- a/lldb/include/lldb/Utility/SharedCluster.h
+++ b/lldb/include/lldb/Utility/SharedCluster.h
@@ -34,6 +34,7 @@ class ClusterManager : public std::enable_shared_from_this<ClusterManager<T>> {
     std::lock_guard<std::mutex> guard(m_mutex);
     auto ret = m_objects.insert(new_object);
     assert(ret.second && "ManageObject called twice for the same object?");
+    (void)ret;
   }
 
   std::shared_ptr<T> GetSharedPointer(T *desired_object) {

diff  --git a/lldb/source/Host/windows/MainLoopWindows.cpp b/lldb/source/Host/windows/MainLoopWindows.cpp
index aca8ef21125c7..ec8ca180f8c64 100644
--- a/lldb/source/Host/windows/MainLoopWindows.cpp
+++ b/lldb/source/Host/windows/MainLoopWindows.cpp
@@ -27,6 +27,7 @@ llvm::Expected<size_t> MainLoopWindows::Poll() {
   for (auto &[fd, info] : m_read_fds) {
     int result = WSAEventSelect(fd, info.event, FD_READ | FD_ACCEPT | FD_CLOSE);
     assert(result == 0);
+    (void)result;
 
     read_events.push_back(info.event);
   }
@@ -37,6 +38,7 @@ llvm::Expected<size_t> MainLoopWindows::Poll() {
   for (auto &fd : m_read_fds) {
     int result = WSAEventSelect(fd.first, WSA_INVALID_EVENT, 0);
     assert(result == 0);
+    (void)result;
   }
 
   if (result >= WSA_WAIT_EVENT_0 &&
@@ -85,6 +87,7 @@ void MainLoopWindows::UnregisterReadObject(IOObject::WaitableHandle handle) {
   assert(it != m_read_fds.end());
   BOOL result = WSACloseEvent(it->second.event);
   assert(result == TRUE);
+  (void)result;
   m_read_fds.erase(it);
 }
 


        


More information about the lldb-commits mailing list