Skip to content

Commit

Permalink
cmake: remove global -Wno-format (#2195)
Browse files Browse the repository at this point in the history
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 <sven.vanhaastregt@arm.com>
  • Loading branch information
svenvh authored Dec 24, 2024
1 parent baed156 commit 2ea4d16
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 4 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test_conformance/basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion test_conformance/c11_atomics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions test_conformance/commonfns/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ set(${MODULE_NAME}_SOURCES
test_binary_fn.cpp
)

set_gnulike_module_compile_flags("-Wno-format")

include(../CMakeCommon.txt)
2 changes: 1 addition & 1 deletion test_conformance/conversions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 2 additions & 0 deletions test_conformance/relationals/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ set(${MODULE_NAME}_SOURCES
test_shuffles.cpp
)

set_gnulike_module_compile_flags("-Wno-format")

include(../CMakeCommon.txt)

0 comments on commit 2ea4d16

Please sign in to comment.