[llvm-branch-commits] [lldb] release/21.x: [lldb] [Windows] Silence format string warnings (#150886) (PR #150919)
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Jul 28 08:21:26 PDT 2025
https://github.com/tru updated https://github.com/llvm/llvm-project/pull/150919
>From 9ffbd30fb68d2b77038c2d0a6a5674340a5492cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Mon, 28 Jul 2025 12:10:46 +0200
Subject: [PATCH] [lldb] [Windows] Silence format string warnings (#150886)
This fixes the following build warnings in a mingw environment:
../../lldb/source/Host/windows/MainLoopWindows.cpp:226:50: warning:
format specifies type 'int' but the argument has type
'IOObject::WaitableHandle' (aka 'void *') [-Wformat]
226 | "File descriptor %d already monitored.", waitable_handle);
| ~~ ^~~~~~~~~~~~~~~
../../lldb/source/Host/windows/MainLoopWindows.cpp:239:49: warning:
format specifies type 'int' but the argument has type 'DWORD' (aka
'unsigned long') [-Wformat]
238 | error = Status::FromErrorStringWithFormat("Unsupported file type
%d",
| ~~
| %lu
239 | file_type);
| ^~~~~~~~~
2 warnings generated.
(cherry picked from commit 98ec927fcb8697a6f6df64298835917aa1d0d3c1)
---
lldb/source/Host/windows/MainLoopWindows.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lldb/source/Host/windows/MainLoopWindows.cpp b/lldb/source/Host/windows/MainLoopWindows.cpp
index a1de895c0ba98..2de5d3d3e9b63 100644
--- a/lldb/source/Host/windows/MainLoopWindows.cpp
+++ b/lldb/source/Host/windows/MainLoopWindows.cpp
@@ -222,7 +222,7 @@ MainLoopWindows::RegisterReadObject(const IOObjectSP &object_sp,
if (m_read_fds.find(waitable_handle) != m_read_fds.end()) {
error = Status::FromErrorStringWithFormat(
- "File descriptor %d already monitored.", waitable_handle);
+ "File descriptor %p already monitored.", waitable_handle);
return nullptr;
}
@@ -234,7 +234,7 @@ MainLoopWindows::RegisterReadObject(const IOObjectSP &object_sp,
} else {
DWORD file_type = GetFileType(waitable_handle);
if (file_type != FILE_TYPE_PIPE) {
- error = Status::FromErrorStringWithFormat("Unsupported file type %d",
+ error = Status::FromErrorStringWithFormat("Unsupported file type %ld",
file_type);
return nullptr;
}
More information about the llvm-branch-commits
mailing list