From 5f0080fbe810caae3750d159da62bac04dbd844f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= Date: Mon, 29 Aug 2022 12:32:10 +0300 Subject: [PATCH] [lldb] Fix warnings about unused variables when building without asserts. NFC. --- lldb/include/lldb/Utility/SharedCluster.h | 1 + lldb/source/Host/windows/MainLoopWindows.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/lldb/include/lldb/Utility/SharedCluster.h b/lldb/include/lldb/Utility/SharedCluster.h index 9f7aa92420ed..2992e6c9beec 100644 --- a/lldb/include/lldb/Utility/SharedCluster.h +++ b/lldb/include/lldb/Utility/SharedCluster.h @@ -34,6 +34,7 @@ public: std::lock_guard 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 GetSharedPointer(T *desired_object) { diff --git a/lldb/source/Host/windows/MainLoopWindows.cpp b/lldb/source/Host/windows/MainLoopWindows.cpp index aca8ef21125c..ec8ca180f8c6 100644 --- a/lldb/source/Host/windows/MainLoopWindows.cpp +++ b/lldb/source/Host/windows/MainLoopWindows.cpp @@ -27,6 +27,7 @@ llvm::Expected 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 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); }