Skip to content

Commit ad3e635

Browse files
committed
[flang] Fix build failures caused by bogus GNU C++ warnings
When I do out-of-tree builds in fir-dev, I get warnings when building lib/Parser/parsing.cpp that something may be uninitialized. I don't get these warnings on in-tree builds or on any builds from llvm-project. I Googled about this and it looks like it's a bug in the GNU C++ compiler. Adding the "-Wno-maybe-unitialized" option fixes this and doesn't break anything else.
1 parent f6db41a commit ad3e635

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

flang/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ if (FLANG_ENABLE_WERROR)
328328
if ( LLVM_COMPILER_IS_GCC_COMPATIBLE )
329329
append("-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
330330
append("-Wno-error" CMAKE_REQUIRED_FLAGS)
331+
append("-Wno-maybe-uninitialized" CMAKE_CXX_FLAGS)
331332
endif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
332333
if (NOT LLVM_ENABLE_WERROR)
333334
message(WARNING "FLANG_ENABLE_WERROR setting is different from LLVM_ENABLE_WERROR.")

0 commit comments

Comments
 (0)