[compiler-rt] 10e1b93 - [compiler-rt] Silence function cast warning when building with Clang ToT targetting Windows

Alexandre Ganea via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 5 17:50:26 PDT 2024


Author: Alexandre Ganea
Date: 2024-07-05T20:49:40-04:00
New Revision: 10e1b935e5d9017067207d62ababa733df088ecd

URL: https://github.com/llvm/llvm-project/commit/10e1b935e5d9017067207d62ababa733df088ecd
DIFF: https://github.com/llvm/llvm-project/commit/10e1b935e5d9017067207d62ababa733df088ecd.diff

LOG: [compiler-rt] Silence function cast warning when building with Clang ToT targetting Windows

Added: 
    

Modified: 
    compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
    compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp b/compiler-rt/lib/fuzzer/FuzzerUtilWindows.cpp
index db80eb383885e..24ea82a8c5dfc 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 aae3e76ea229f..a7ffe0e48fabe 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();
 


        


More information about the llvm-commits mailing list