[Lldb-commits] [lldb] [LLDB] Silence warnings when building on Windows (PR #191566)

via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 10 16:05:48 PDT 2026


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Alexandre Ganea (aganea)

<details>
<summary>Changes</summary>

Fixes a few warnings found while building the LLVM installer with `llvm/utils/release/build_llvm_release.bat --x64 --version 23.0.0 --skip-checkout --local-python`.

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


4 Files Affected:

- (modified) lldb/source/Host/windows/ProcessLauncherWindows.cpp (+1) 
- (modified) lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp (+4-1) 
- (modified) lldb/tools/lldb-dap/RunInTerminal.cpp (+1-1) 
- (modified) lldb/unittests/Platform/TestUtils.cpp (+1) 


``````````diff
diff --git a/lldb/source/Host/windows/ProcessLauncherWindows.cpp b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
index b9cc49d8c5ca5..79e0faca64961 100644
--- a/lldb/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/lldb/source/Host/windows/ProcessLauncherWindows.cpp
@@ -340,6 +340,7 @@ HANDLE ProcessLauncherWindows::GetStdioHandle(const llvm::StringRef path,
     break;
   case STDERR_FILENO:
     flags = FILE_FLAG_WRITE_THROUGH;
+    [[fallthrough]];
   case STDOUT_FILENO:
     access = GENERIC_WRITE;
     create = CREATE_ALWAYS;
diff --git a/lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp b/lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp
index b71e10b9c82e7..25b602286ce12 100644
--- a/lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp
+++ b/lldb/source/Host/windows/PythonPathSetup/PythonPathSetup.cpp
@@ -19,6 +19,8 @@
 
 using namespace llvm;
 
+#if defined(LLDB_PYTHON_DLL_RELATIVE_PATH) ||                                  \
+    defined(LLDB_PYTHON_RUNTIME_LIBRARY_FILENAME)
 static std::string GetModulePath(HMODULE module) {
   std::vector<WCHAR> buffer(MAX_PATH);
   while (buffer.size() <= PATHCCH_MAX_CCH) {
@@ -36,11 +38,12 @@ static std::string GetModulePath(HMODULE module) {
   }
   return "";
 }
+#endif
 
+#ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
 /// Returns the full path to the lldb.exe executable.
 static std::string GetPathToExecutable() { return GetModulePath(NULL); }
 
-#ifdef LLDB_PYTHON_DLL_RELATIVE_PATH
 bool AddPythonDLLToSearchPath() {
   std::string path_str = GetPathToExecutable();
   if (path_str.empty())
diff --git a/lldb/tools/lldb-dap/RunInTerminal.cpp b/lldb/tools/lldb-dap/RunInTerminal.cpp
index 28be4a9904942..75bdac910f1f8 100644
--- a/lldb/tools/lldb-dap/RunInTerminal.cpp
+++ b/lldb/tools/lldb-dap/RunInTerminal.cpp
@@ -171,7 +171,7 @@ Expected<std::shared_ptr<FifoFile>> CreateRunInTerminalCommFile() {
   SmallString<256> comm_file;
 #if _WIN32
   char pipe_name[MAX_PATH];
-  sprintf(pipe_name, "\\\\.\\pipe\\lldb-dap-run-in-terminal-comm-%d",
+  sprintf(pipe_name, "\\\\.\\pipe\\lldb-dap-run-in-terminal-comm-%lu",
           GetCurrentProcessId());
   return CreateFifoFile(pipe_name);
 #else
diff --git a/lldb/unittests/Platform/TestUtils.cpp b/lldb/unittests/Platform/TestUtils.cpp
index 7330395c803f8..d28375b220d82 100644
--- a/lldb/unittests/Platform/TestUtils.cpp
+++ b/lldb/unittests/Platform/TestUtils.cpp
@@ -36,6 +36,7 @@ std::string lldb_private::CreateFile(llvm::StringRef filename,
   int fd;
   std::error_code ret = llvm::sys::fs::openFileForWrite(path, fd);
   assert(!ret && "Failed to create test file.");
+  (void)ret;
   ::close(fd);
 
   return path.c_str();

``````````

</details>


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


More information about the lldb-commits mailing list