[libcxx] r191814 - Explicitly specify -Wno-error if LIBCXX_ENABLE_WERROR is false.

Alexey Samsonov samsonov at google.com
Thu Oct 3 04:18:28 PDT 2013


On Wed, Oct 2, 2013 at 8:52 PM, David Blaikie <dblaikie at gmail.com> wrote:

>
> On Oct 2, 2013 12:49 AM, "Alexey Samsonov" <samsonov at google.com> wrote:
> >
> > Author: samsonov
> > Date: Wed Oct  2 02:44:19 2013
> > New Revision: 191814
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=191814&view=rev
> > Log:
> > Explicitly specify -Wno-error if LIBCXX_ENABLE_WERROR is false.
> >
> > libcxx doesn't build with -Werror because of #warnings in its source
> > code.
>
> This seems a little problematic. Is there no way to get a clean libcxx
> build? If not, should we enable certain warnings as errors (I'm looking at
> you, -Wreturn-type)? Or, perhaps better, use -Werror and downgrade specific
> warnings back to warnings (or disable them entirely)
>
+Howard

The only warnings I see (when I use ToT Clang) are "#warning exception_ptr
not yet implemented" and "#warning uncaught_exception not yet implemented",
which fail because of -W#warnings and -Wpedantic.
I wasn't able to quickly disable #warnings, as Clang doesn't support
-Wno-cpp, and -Wno-#warnings breaks CMake because of # symbol :)
Are there any plans for actually implementing these missing parts of
exception.cpp on Linux?


> > But when libcxx is built as an external LLVM project, it inherits
> > LLVM build flags, breaking the build if LLVM_ENABLE_WERROR is enabled.
> >
> > Modified:
> >     libcxx/trunk/CMakeLists.txt
> >     libcxx/trunk/cmake/config-ix.cmake
> >
> > Modified: libcxx/trunk/CMakeLists.txt
> > URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=191814&r1=191813&r2=191814&view=diff
> >
> ==============================================================================
> > --- libcxx/trunk/CMakeLists.txt (original)
> > +++ libcxx/trunk/CMakeLists.txt Wed Oct  2 02:44:19 2013
> > @@ -189,6 +189,9 @@ append_if(LIBCXX_CXX_WARNING_FLAGS LIBCX
> >  if (LIBCXX_ENABLE_WERROR)
> >    append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_WERROR_FLAG -Werror)
> >    append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_WX_FLAG -WX)
> > +else()
> > +  append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_WNO_ERROR_FLAG
> -Wno-error)
> > +  append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_NO_WX_FLAG -WX-)
> >  endif()
> >  if (LIBCXX_ENABLE_PEDANTIC)
> >    append_if(LIBCXX_CXX_WARNING_FLAGS LIBCXX_HAS_PEDANTIC_FLAG -pedantic)
> >
> > Modified: libcxx/trunk/cmake/config-ix.cmake
> > URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/cmake/config-ix.cmake?rev=191814&r1=191813&r2=191814&view=diff
> >
> ==============================================================================
> > --- libcxx/trunk/cmake/config-ix.cmake (original)
> > +++ libcxx/trunk/cmake/config-ix.cmake Wed Oct  2 02:44:19 2013
> > @@ -13,9 +13,11 @@ check_cxx_compiler_flag(-Wwrite-strings
> >  check_cxx_compiler_flag(-Wno-long-long
>  LIBCXX_HAS_WNO_LONG_LONG_FLAG)
> >  check_cxx_compiler_flag(-pedantic             LIBCXX_HAS_PEDANTIC_FLAG)
> >  check_cxx_compiler_flag(-Werror               LIBCXX_HAS_WERROR_FLAG)
> > +check_cxx_compiler_flag(-Wno-error            LIBCXX_HAS_WNO_ERROR_FLAG)
> >  check_cxx_compiler_flag(-fno-exceptions
> LIBCXX_HAS_FNO_EXCEPTIONS_FLAG)
> >  check_cxx_compiler_flag(-fno-rtti             LIBCXX_HAS_FNO_RTTI_FLAG)
> >  check_cxx_compiler_flag(/WX                   LIBCXX_HAS_WX_FLAG)
> > +check_cxx_compiler_flag(/WX-                  LIBCXX_HAS_NO_WX_FLAG)
> >  check_cxx_compiler_flag(/EHsc                 LIBCXX_HAS_EHSC_FLAG)
> >  check_cxx_compiler_flag(/EHs-                 LIBCXX_HAS_NO_EHS_FLAG)
> >  check_cxx_compiler_flag(/EHa-                 LIBCXX_HAS_NO_EHA_FLAG)
> >
> >
> > _______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131003/4139d6e6/attachment.html>


More information about the cfe-commits mailing list