From b8fdc9bf5d4aa490b6f62720d11a482b86c1d66e Mon Sep 17 00:00:00 2001 From: offa Date: Wed, 28 Sep 2022 17:45:54 +0200 Subject: [PATCH] Workaround GCC 12 warning --- tests/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7fe4791e..d2f89882 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -57,6 +57,11 @@ function(spdlog_prepare_test test_target spdlog_lib) endif() add_test(NAME ${test_target} COMMAND ${test_target}) set_tests_properties(${test_target} PROPERTIES RUN_SERIAL ON) + + # Workaround GCC 12 false positive + if( CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND "${CMAKE_CXX_COMPILER_VERSION}" MATCHES "^12\..*") + target_compile_options(${test_target} PRIVATE "-Wno-maybe-uninitialized") + endif() endfunction() # The compiled library tests