From 10e1b935e5d9017067207d62ababa733df088ecd Mon Sep 17 00:00:00 2001 From: Alexandre Ganea Date: Fri, 5 Jul 2024 20:46:55 -0400 Subject: [compiler-rt] Silence function cast warning when building with Clang ToT targetting Windows --- compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp | 9 +++++++++ compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp index db80eb3..24ea82a 100644 --- a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp +++ b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp @@ -238,6 +238,11 @@ size_t PageSize() { return PageSizeCached; } +#if defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wcast-function-type-mismatch" +#endif + void SetThreadName(std::thread &thread, const std::string &name) { typedef HRESULT(WINAPI * proc)(HANDLE, PCWSTR); HMODULE kbase = GetModuleHandleA("KernelBase.dll"); @@ -255,6 +260,10 @@ void SetThreadName(std::thread &thread, const std::string &name) { } } +#if defined(__clang__) +#pragma clang diagnostic pop +#endif + } // namespace fuzzer #endif // LIBFUZZER_WINDOWS diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp index aae3e76..a7ffe0e4 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp +++ b/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp @@ -55,6 +55,11 @@ bool TrySymInitialize() { } // namespace +# if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wcast-function-type-mismatch" +# endif + // Initializes DbgHelp library, if it's not yet initialized. Calls to this // function should be synchronized with respect to other calls to DbgHelp API // (e.g. from WinSymbolizerTool). @@ -133,6 +138,10 @@ void InitializeDbgHelpIfNeeded() { } } +# if defined(__clang__) +# pragma clang diagnostic pop +# endif + bool WinSymbolizerTool::SymbolizePC(uptr addr, SymbolizedStack *frame) { InitializeDbgHelpIfNeeded(); -- cgit v1.1