[PATCH] Turn off uninitialized-use warnings for gcc in cmake build
Chandler Carruth
chandlerc at gmail.com
Wed Jan 30 15:26:28 PST 2013
If I can jump in...
================
Comment at: cmake/config-ix.cmake:320-322
@@ +319,5 @@
+ else()
+ # In older versions of gcc, the compiler flag check above will still pass
+ # for unsupported -W flags. In such cases, just use -Wno-uninitialized if
+ # available.
+ execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GXX_VERSION)
----------------
So, why not test for -Wmaybe-uninitialized?
Many versions of GCC ignore -Wno-... flags they don't understand, but I think they're very rigorous about supporting a -Wno-... variant for every flag the support a -W... variant of, so test for the positive one.
My expected logic here is:
- If GCC
- If -Wmaybe-uninitiaziled is supported, use -Wno-maybe-uninitialized
- Else use -Wno-uninitialized
http://llvm-reviews.chandlerc.com/D353
BRANCH
gcc_cmake_fix
ARCANIST PROJECT
llvm
More information about the llvm-commits
mailing list