Skip to content

Commit 10e1b93

Browse files
committed
[compiler-rt] Silence function cast warning when building with Clang ToT targetting Windows
1 parent 593f708 commit 10e1b93

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ size_t PageSize() {
238238
return PageSizeCached;
239239
}
240240

241+
#if defined(__clang__)
242+
#pragma clang diagnostic push
243+
#pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
244+
#endif
245+
241246
void SetThreadName(std::thread &thread, const std::string &name) {
242247
typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR);
243248
HMODULE kbase = GetModuleHandleA("KernelBase.dll");
@@ -255,6 +260,10 @@ void SetThreadName(std::thread &thread, const std::string &name) {
255260
}
256261
}
257262

263+
#if defined(__clang__)
264+
#pragma clang diagnostic pop
265+
#endif
266+
258267
} // namespace fuzzer
259268

260269
#endif // LIBFUZZER_WINDOWS

compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ bool TrySymInitialize() {
5555

5656
} // namespace
5757

58+
# if defined(__clang__)
59+
# pragma clang diagnostic push
60+
# pragma clang diagnostic ignored "-Wcast-function-type-mismatch"
61+
# endif
62+
5863
// Initializes DbgHelp library, if it's not yet initialized. Calls to this
5964
// function should be synchronized with respect to other calls to DbgHelp API
6065
// (e.g. from WinSymbolizerTool).
@@ -133,6 +138,10 @@ void InitializeDbgHelpIfNeeded() {
133138
}
134139
}
135140

141+
# if defined(__clang__)
142+
# pragma clang diagnostic pop
143+
# endif
144+
136145
bool WinSymbolizerTool::SymbolizePC(uptr addr, SymbolizedStack *frame) {
137146
InitializeDbgHelpIfNeeded();
138147

0 commit comments

Comments
 (0)