File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -431,15 +431,13 @@ set(USE_NO_UNINITIALIZED 0)
431431# Disable gcc's potentially uninitialized use analysis as it presents lots of
432432# false positives.
433433if (CMAKE_COMPILER_IS_GNUCXX)
434- check_cxx_compiler_flag("-Wmaybe-uninitialized" HAS_MAYBE_UNINITIALIZED)
435- if (HAS_MAYBE_UNINITIALIZED)
436- set (USE_NO_MAYBE_UNINITIALIZED 1)
437- else ()
438- # Only recent versions of gcc make the distinction between -Wuninitialized
439- # and -Wmaybe-uninitialized. If -Wmaybe-uninitialized isn't supported, just
440- # turn off all uninitialized use warnings.
434+ # Disable all -Wuninitialized warning for old GCC versions.
435+ if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
441436 check_cxx_compiler_flag("-Wuninitialized" HAS_UNINITIALIZED)
442437 set (USE_NO_UNINITIALIZED ${HAS_UNINITIALIZED} )
438+ else ()
439+ check_cxx_compiler_flag("-Wmaybe-uninitialized" HAS_MAYBE_UNINITIALIZED)
440+ set (USE_NO_MAYBE_UNINITIALIZED ${HAS_MAYBE_UNINITIALIZED} )
443441 endif ()
444442endif ()
445443
You can’t perform that action at this time.
0 commit comments