Skip to content

Commit 98ec927

Browse files
authored
[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.
1 parent 3308fc4 commit 98ec927

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lldb/source/Host/windows/MainLoopWindows.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ MainLoopWindows::RegisterReadObject(const IOObjectSP &object_sp,
223223

224224
if (m_read_fds.find(waitable_handle) != m_read_fds.end()) {
225225
error = Status::FromErrorStringWithFormat(
226-
"File descriptor %d already monitored.", waitable_handle);
226+
"File descriptor %p already monitored.", waitable_handle);
227227
return nullptr;
228228
}
229229

@@ -235,7 +235,7 @@ MainLoopWindows::RegisterReadObject(const IOObjectSP &object_sp,
235235
} else {
236236
DWORD file_type = GetFileType(waitable_handle);
237237
if (file_type != FILE_TYPE_PIPE) {
238-
error = Status::FromErrorStringWithFormat("Unsupported file type %d",
238+
error = Status::FromErrorStringWithFormat("Unsupported file type %ld",
239239
file_type);
240240
return nullptr;
241241
}

0 commit comments

Comments
 (0)