build: -Wimplicit-fallthrough warning for GCC 7+ only
This commit is contained in:
parent
6b581c4e51
commit
ef2548778c
@ -120,7 +120,9 @@ if(CV_GCC OR CV_CLANG)
|
|||||||
add_extra_compiler_option(-Wno-unnamed-type-template-args)
|
add_extra_compiler_option(-Wno-unnamed-type-template-args)
|
||||||
add_extra_compiler_option(-Wno-comment)
|
add_extra_compiler_option(-Wno-comment)
|
||||||
if(NOT OPENCV_SKIP_IMPLICIT_FALLTHROUGH
|
if(NOT OPENCV_SKIP_IMPLICIT_FALLTHROUGH
|
||||||
AND NOT " ${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}" MATCHES "implicit-fallthrough")
|
AND NOT " ${CMAKE_CXX_FLAGS} ${OPENCV_EXTRA_FLAGS} ${OPENCV_EXTRA_CXX_FLAGS}" MATCHES "implicit-fallthrough"
|
||||||
|
AND (CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
|
||||||
|
)
|
||||||
add_extra_compiler_option(-Wimplicit-fallthrough=3)
|
add_extra_compiler_option(-Wimplicit-fallthrough=3)
|
||||||
endif()
|
endif()
|
||||||
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.2.0)
|
if(CV_GCC AND CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL 7.2.0)
|
||||||
|
|||||||
@ -65,7 +65,7 @@ using namespace std;
|
|||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
|
#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
|
||||||
#endif
|
#endif
|
||||||
#if defined(__GNUC__)
|
#if defined(__GNUC__) && __GNUC__ >= 7
|
||||||
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
#pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user