[cfe-commits] [PATCH] [libcxx][build] ignore unknown pragmas on GCC

Saleem Abdulrasool compnerd at compnerd.org
Tue Dec 25 08:50:25 PST 2012


Hi Bigcheese, chandlerc,

When building with GCC with extended warning flags, unknown pragmas
(erroneously) trigger warnings.  Pass -Wno-unknown-pragmas to avoid this
warning.  Technically, the compiler should discard any pragmas it does not
explicitly support, so, this warning is not adding much and should be safe to
disable.

http://llvm-reviews.chandlerc.com/D240

Files:
  CMakeLists.txt

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt
+++ CMakeLists.txt
@@ -152,6 +152,9 @@
 if (LIBCXX_ENABLE_PEDANTIC)
   append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_PEDANTIC_FLAG -pedantic)
 endif()
+if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
+    list(APPEND LIBCXX_CXX_WARNING_FLAGS -Wno-unknown-pragmas)
+endif ()
 
 # Get feature flags.
 # Exceptions
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D240.1.patch
Type: text/x-patch
Size: 429 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20121225/96a9afb0/attachment.bin>


More information about the cfe-commits mailing list