[Lldb-commits] [lldb] [lldb] Avoid build warnings when building for Windows. NFC. (PR #159345)
Martin Storsjö via lldb-commits
lldb-commits at lists.llvm.org
Wed Sep 17 05:24:20 PDT 2025
https://github.com/mstorsjo created https://github.com/llvm/llvm-project/pull/159345
This avoids the following warnings from Clang:
../../lldb/source/Host/windows/Host.cpp:324:3: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
324 | default:
| ^
../../lldb/source/Host/common/File.cpp:662:26: warning: cast from 'const void *' to 'char *' drops const qualifier [-Wcast-qual]
662 | .write((char *)buf, num_bytes);
| ^
>From 7577ab2c2d29efa705cae85b8a9b914a61e47140 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
Date: Wed, 17 Sep 2025 15:21:08 +0300
Subject: [PATCH] [lldb] Avoid build warnings when building for Windows. NFC.
This avoids the following warnings from Clang:
../../lldb/source/Host/windows/Host.cpp:324:3: warning: default label in switch which covers all enumeration values [-Wcovered-switch-default]
324 | default:
| ^
../../lldb/source/Host/common/File.cpp:662:26: warning: cast from 'const void *' to 'char *' drops const qualifier [-Wcast-qual]
662 | .write((char *)buf, num_bytes);
| ^
---
lldb/source/Host/common/File.cpp | 2 +-
lldb/source/Host/windows/Host.cpp | 1 -
2 files changed, 1 insertion(+), 2 deletions(-)
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index 8fd1ca069dc01..1272f13c1d82d 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -659,7 +659,7 @@ Status NativeFile::Write(const void *buf, size_t &num_bytes) {
#ifdef _WIN32
if (is_windows_console) {
llvm::raw_fd_ostream(_fileno(m_stream), false)
- .write((char *)buf, num_bytes);
+ .write((const char *)buf, num_bytes);
return error;
}
#endif
diff --git a/lldb/source/Host/windows/Host.cpp b/lldb/source/Host/windows/Host.cpp
index e8973a3fb937a..d5704eed10ecb 100644
--- a/lldb/source/Host/windows/Host.cpp
+++ b/lldb/source/Host/windows/Host.cpp
@@ -321,7 +321,6 @@ void Host::SystemLog(Severity severity, llvm::StringRef message) {
stream << "[Error] ";
break;
case lldb::eSeverityInfo:
- default:
stream << "[Info] ";
break;
}
More information about the lldb-commits
mailing list