From 2ea4d165d5242e6f642151538436bc47295f2773 Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Tue, 24 Dec 2024 14:49:31 +0100 Subject: [PATCH] cmake: remove global -Wno-format (#2195) Move the global `-Wno-format` compiler option to the individual tests that still trigger Wformat warnings. The majority of the tests now compile cleanly with `-Wformat` enabled. Signed-off-by: Sven van Haastregt --- CMakeLists.txt | 1 - test_conformance/basic/CMakeLists.txt | 2 +- test_conformance/c11_atomics/CMakeLists.txt | 2 +- test_conformance/commonfns/CMakeLists.txt | 2 ++ test_conformance/conversions/CMakeLists.txt | 2 +- test_conformance/relationals/CMakeLists.txt | 2 ++ 6 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4c31818..40deed8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -104,7 +104,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang" # Enable more warnings if not doing a release build. add_cxx_flag_if_supported(-Wall) endif() - add_cxx_flag_if_supported(-Wno-format) add_cxx_flag_if_supported(-Wno-error=cpp) # Allow #warning directive add_cxx_flag_if_supported(-Wno-unknown-pragmas) # Issue #785 add_cxx_flag_if_supported(-Wno-error=asm-operand-widths) # Issue #784 diff --git a/test_conformance/basic/CMakeLists.txt b/test_conformance/basic/CMakeLists.txt index 7292bc9d..a2b47402 100644 --- a/test_conformance/basic/CMakeLists.txt +++ b/test_conformance/basic/CMakeLists.txt @@ -71,6 +71,6 @@ if(APPLE) list(APPEND ${MODULE_NAME}_SOURCES test_queue_priority.cpp) endif(APPLE) -set_gnulike_module_compile_flags("-Wno-sign-compare") +set_gnulike_module_compile_flags("-Wno-sign-compare -Wno-format") include(../CMakeCommon.txt) diff --git a/test_conformance/c11_atomics/CMakeLists.txt b/test_conformance/c11_atomics/CMakeLists.txt index 0d389bce..29e224ff 100644 --- a/test_conformance/c11_atomics/CMakeLists.txt +++ b/test_conformance/c11_atomics/CMakeLists.txt @@ -7,6 +7,6 @@ set(${MODULE_NAME}_SOURCES test_atomics.cpp ) -set_gnulike_module_compile_flags("-Wno-sign-compare") +set_gnulike_module_compile_flags("-Wno-sign-compare -Wno-format") include(../CMakeCommon.txt) diff --git a/test_conformance/commonfns/CMakeLists.txt b/test_conformance/commonfns/CMakeLists.txt index bea20cf5..e7752474 100644 --- a/test_conformance/commonfns/CMakeLists.txt +++ b/test_conformance/commonfns/CMakeLists.txt @@ -10,4 +10,6 @@ set(${MODULE_NAME}_SOURCES test_binary_fn.cpp ) +set_gnulike_module_compile_flags("-Wno-format") + include(../CMakeCommon.txt) diff --git a/test_conformance/conversions/CMakeLists.txt b/test_conformance/conversions/CMakeLists.txt index 32990eba..037430ef 100644 --- a/test_conformance/conversions/CMakeLists.txt +++ b/test_conformance/conversions/CMakeLists.txt @@ -12,6 +12,6 @@ if("${CLConform_TARGET_ARCH}" STREQUAL "ARM" OR "${CLConform_TARGET_ARCH}" STREQ list(APPEND ${MODULE_NAME}_SOURCES fplib.cpp) endif() -set_gnulike_module_compile_flags("-Wno-sign-compare") +set_gnulike_module_compile_flags("-Wno-sign-compare -Wno-format") include(../CMakeCommon.txt) diff --git a/test_conformance/relationals/CMakeLists.txt b/test_conformance/relationals/CMakeLists.txt index aa5dd6a1..183fdd1d 100644 --- a/test_conformance/relationals/CMakeLists.txt +++ b/test_conformance/relationals/CMakeLists.txt @@ -7,5 +7,7 @@ set(${MODULE_NAME}_SOURCES test_shuffles.cpp ) +set_gnulike_module_compile_flags("-Wno-format") + include(../CMakeCommon.txt)