Skip to content

Commit b43a3db

Browse files
committed
Detect support for and use -Wimplicit-fallthrough
1 parent 0ff9593 commit b43a3db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ else()
221221
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
222222
-Wstrict-prototypes -std=gnu99)
223223

224+
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
225+
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
226+
add_definitions(-Wimplicit-fallthrough)
227+
endif()
228+
224229
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
225230
# 3.4.1 used there.
226231
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")

0 commit comments

Comments
 (0)