[flang-commits] [flang] a9795b6 - [flang] Disable -Wmaybe-uninitialized for GCC

Tim Keith via flang-commits flang-commits at lists.llvm.org
Tue Aug 11 07:20:35 PDT 2020


Author: Tim Keith
Date: 2020-08-11T07:20:15-07:00
New Revision: a9795b6f639f976e2d6f690066c61f890eed534f

URL: https://github.com/llvm/llvm-project/commit/a9795b6f639f976e2d6f690066c61f890eed534f
DIFF: https://github.com/llvm/llvm-project/commit/a9795b6f639f976e2d6f690066c61f890eed534f.diff

LOG: [flang] Disable -Wmaybe-uninitialized for GCC

According to llvm/cmake/config-ix.cmake, gcc's potentially uninitialized
use analysis has lots of false positives. We are encountering one in
flang/lib/Lower/CharacterExpr.cpp.

That warning is disabled for gcc in in-tree builds; this does the same
thing for out-of-tree builds.

Differential Revision: https://reviews.llvm.org/D85694

Added: 
    

Modified: 
    flang/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/flang/CMakeLists.txt b/flang/CMakeLists.txt
index 0e3228bff3d8..73c2db55e8f8 100644
--- a/flang/CMakeLists.txt
+++ b/flang/CMakeLists.txt
@@ -64,6 +64,9 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
   endif()
   option(LLVM_ENABLE_WARNINGS "Enable compiler warnings." ON)
   option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
+  if(CMAKE_COMPILER_IS_GNUCXX)
+    set(USE_NO_MAYBE_UNINITIALIZED 1)
+  endif()
 
   include(CMakeParseArguments)
   include(AddLLVM)


        


More information about the flang-commits mailing list