[compiler-rt] r352144 - [libFuzzer][MSVC] Disable exceptions in MSVC headers

Jonathan Metzman via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 24 17:10:57 PST 2019


Author: metzman
Date: Thu Jan 24 17:10:57 2019
New Revision: 352144

URL: http://llvm.org/viewvc/llvm-project?rev=352144&view=rev
Log:
[libFuzzer][MSVC] Disable exceptions in MSVC headers

Summary:
Disable exceptions in MSVC headers using -D_HAS_EXCEPTIONS=0
to silence compiler warning instead of using /Ehsc.

Reviewers: rnk, morehouse, metzman

Reviewed By: rnk, morehouse, metzman

Subscribers: rnk, morehouse, mgorny

Differential Revision: https://reviews.llvm.org/D57119

Modified:
    compiler-rt/trunk/lib/fuzzer/CMakeLists.txt

Modified: compiler-rt/trunk/lib/fuzzer/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/fuzzer/CMakeLists.txt?rev=352144&r1=352143&r2=352144&view=diff
==============================================================================
--- compiler-rt/trunk/lib/fuzzer/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/fuzzer/CMakeLists.txt Thu Jan 24 17:10:57 2019
@@ -72,9 +72,10 @@ if (CMAKE_CXX_FLAGS MATCHES "fsanitize-c
 endif()
 
 if(MSVC)
-  # Silence warnings with /Ehsc and avoid an error by unecessarily defining
-  # thread_local when it isn't even used on Windows.
-  list(APPEND LIBFUZZER_CFLAGS /EHsc)
+  # Silence warnings by turning off exceptions in MSVC headers and avoid an
+  # error by unecessarily defining thread_local when it isn't even used on
+  # Windows.
+  list(APPEND LIBFUZZER_CFLAGS -D_HAS_EXCEPTIONS=0)
 else()
   if(NOT HAS_THREAD_LOCAL)
     list(APPEND LIBFUZZER_CFLAGS -Dthread_local=__thread)




More information about the llvm-commits mailing list