Detect support for and use -Wimplicit-fallthrough

This commit is contained in:
James McCoy 2017-05-02 23:58:04 -04:00
parent 0ff959329b
commit b43a3dbff8

View File

@ -221,6 +221,11 @@ else()
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
-Wstrict-prototypes -std=gnu99) -Wstrict-prototypes -std=gnu99)
check_c_compiler_flag(-Wimplicit-fallthrough HAS_WIMPLICIT_FALLTHROUGH_FLAG)
if(HAS_WIMPLICIT_FALLTHROUGH_FLAG)
add_definitions(-Wimplicit-fallthrough)
endif()
# On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang # On FreeBSD 64 math.h uses unguarded C11 extension, which taints clang
# 3.4.1 used there. # 3.4.1 used there.
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")