Skip to content

Commit 2ea4d16

Browse files
authored
cmake: remove global -Wno-format (KhronosGroup#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 <[email protected]>
1 parent baed156 commit 2ea4d16

File tree

6 files changed

+7
-4
lines changed

6 files changed

+7
-4
lines changed

CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?Clang"
104104
# Enable more warnings if not doing a release build.
105105
add_cxx_flag_if_supported(-Wall)
106106
endif()
107-
add_cxx_flag_if_supported(-Wno-format)
108107
add_cxx_flag_if_supported(-Wno-error=cpp) # Allow #warning directive
109108
add_cxx_flag_if_supported(-Wno-unknown-pragmas) # Issue #785
110109
add_cxx_flag_if_supported(-Wno-error=asm-operand-widths) # Issue #784

test_conformance/basic/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,6 @@ if(APPLE)
7171
list(APPEND ${MODULE_NAME}_SOURCES test_queue_priority.cpp)
7272
endif(APPLE)
7373

74-
set_gnulike_module_compile_flags("-Wno-sign-compare")
74+
set_gnulike_module_compile_flags("-Wno-sign-compare -Wno-format")
7575

7676
include(../CMakeCommon.txt)

test_conformance/c11_atomics/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ set(${MODULE_NAME}_SOURCES
77
test_atomics.cpp
88
)
99

10-
set_gnulike_module_compile_flags("-Wno-sign-compare")
10+
set_gnulike_module_compile_flags("-Wno-sign-compare -Wno-format")
1111

1212
include(../CMakeCommon.txt)

test_conformance/commonfns/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ set(${MODULE_NAME}_SOURCES
1010
test_binary_fn.cpp
1111
)
1212

13+
set_gnulike_module_compile_flags("-Wno-format")
14+
1315
include(../CMakeCommon.txt)

test_conformance/conversions/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ if("${CLConform_TARGET_ARCH}" STREQUAL "ARM" OR "${CLConform_TARGET_ARCH}" STREQ
1212
list(APPEND ${MODULE_NAME}_SOURCES fplib.cpp)
1313
endif()
1414

15-
set_gnulike_module_compile_flags("-Wno-sign-compare")
15+
set_gnulike_module_compile_flags("-Wno-sign-compare -Wno-format")
1616

1717
include(../CMakeCommon.txt)

test_conformance/relationals/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,7 @@ set(${MODULE_NAME}_SOURCES
77
test_shuffles.cpp
88
)
99

10+
set_gnulike_module_compile_flags("-Wno-format")
11+
1012
include(../CMakeCommon.txt)
1113

0 commit comments

Comments
 (0)