[PATCH] D85694: [flang] Disable -Wmaybe-uninitialized for GCC

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 15:58:12 PDT 2020


tskeith created this revision.
tskeith added reviewers: klausler, PeteSteinfeld, schweitz, sscalpone.
tskeith added a project: Flang.
Herald added subscribers: llvm-commits, mgorny.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
tskeith requested review of this revision.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D85694

Files:
  flang/CMakeLists.txt


Index: flang/CMakeLists.txt
===================================================================
--- flang/CMakeLists.txt
+++ flang/CMakeLists.txt
@@ -64,6 +64,9 @@
   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)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85694.284521.patch
Type: text/x-patch
Size: 442 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200810/e60b7287/attachment.bin>


More information about the llvm-commits mailing list