[PATCH] D54470: Avoid g++ warning spam

Christian Iversen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 13 05:01:35 PST 2018


chrivers created this revision.
Herald added subscribers: llvm-commits, mgorny.

Repository:
  rL LLVM

https://reviews.llvm.org/D54470

Files:
  cmake/modules/HandleLLVMOptions.cmake


Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake
+++ cmake/modules/HandleLLVMOptions.cmake
@@ -619,6 +619,14 @@
     append("-Wno-comment" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
   endif()
 
+  # g++ likes to generate a 12 line warning every time the
+  # SchedulerRegistry is referenced, which makes actual warnings and
+  # errors hard to find. Disabling the warning is not ideal, but is
+  # probably better than having other warnings and errors overlooked.
+  if (CMAKE_COMPILER_IS_GNUCXX)
+    add_flag_if_supported("-Wno-cast-function-type" NO_CAST_FUNCTION_TYPE_FLAG)
+  endif()
+
   # Enable -Wstring-conversion to catch misuse of string literals.
   add_flag_if_supported("-Wstring-conversion" STRING_CONVERSION_FLAG)
 endif (LLVM_ENABLE_WARNINGS AND (LLVM_COMPILER_IS_GCC_COMPATIBLE OR CLANG_CL))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54470.173835.patch
Type: text/x-patch
Size: 905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181113/194e3096/attachment.bin>


More information about the llvm-commits mailing list