http://llvm.org/pr23335

When building clang with gcc 4.9.1, there are many 'array subscript is
above array bounds' warnings from clang/Basic/Diagnostic.h. This patch
silences these warnings.
Index: cmake/modules/HandleLLVMOptions.cmake
===================================================================
--- cmake/modules/HandleLLVMOptions.cmake       (revision 235720)
+++ cmake/modules/HandleLLVMOptions.cmake       (working copy)
@@ -346,6 +346,9 @@
   if (LLVM_ENABLE_WARNINGS)
     append("-Wall -W -Wno-unused-parameter -Wwrite-strings" CMAKE_C_FLAGS 
CMAKE_CXX_FLAGS)
     append("-Wcast-qual" CMAKE_CXX_FLAGS)
+    if (CMAKE_COMPILER_IS_GNUCXX)
+      append(" -Wno-array-bounds" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
+    endif()
 
     # Turn off missing field initializer warnings for gcc to avoid noise from
     # false positives with empty {}. Turn them on otherwise (they're off by
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to