Skip to content

Commit a26f940

Browse files
committed
CMake: Add some warning flags for clang 13 or newer
Same as Autoconf. This is a follow-up to 54974c9.
1 parent 22b4e0a commit a26f940

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1204,6 +1204,7 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
12041204
check_and_add_compiler_option(-Wcomma)
12051205
check_and_add_compiler_option(-Wmissing-prototypes)
12061206
check_and_add_compiler_option(-Wmissing-variable-declarations)
1207+
check_and_add_compiler_option(-Wnull-pointer-subtraction)
12071208
check_and_add_compiler_option(-Wold-style-definition)
12081209
if(NOT CMAKE_C_COMPILER_ID MATCHES "Sun")
12091210
# In Sun C versions that implement GCC compatibility "-Wpedantic"
@@ -1219,6 +1220,8 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.devel OR EXISTS ${CMAKE_BINARY_DIR}/.devel)
12191220
check_and_add_compiler_option(-Wstrict-prototypes)
12201221
check_and_add_compiler_option(-Wundef)
12211222
check_and_add_compiler_option(-Wunreachable-code-return)
1223+
check_and_add_compiler_option(-Wunused-but-set-parameter)
1224+
check_and_add_compiler_option(-Wunused-but-set-variable)
12221225
check_and_add_compiler_option(-Wused-but-marked-unused)
12231226
check_and_add_compiler_option(-Wwrite-strings)
12241227
endif()

0 commit comments

Comments
 (0)