Skip to content

Commit 03f0ccf

Browse files
committed
Update warnings for Clang 9+
1 parent fec5da2 commit 03f0ccf

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

cmake/EnableWarnings.cmake

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,23 +82,23 @@ function(enable_warnings target)
8282
if(NOT WIN32)
8383
# Lot's of false-positives on windows.
8484
# E.g. __builtin_ia32_crc32qi on MinGW and SDL
85-
check_and_add_warnings(TARGET ${target} VISIBILITY ${visibility}
86-
CXX -Wredundant-decls
87-
)
85+
check_and_add_warnings(TARGET ${target} VISIBILITY ${visibility} CXX -Wredundant-decls)
8886
endif()
8987
# Prior to 9.2 "final" was not considered "override"
9088
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.2)
9189
target_compile_options(${target} ${visibility} $<$<COMPILE_LANGUAGE:CXX>:-Wsuggest-override -Wno-error=suggest-override>)
9290
endif()
9391
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
9492
# Lot's of false-positives on for e.g. strcmp
95-
check_and_add_warnings(TARGET ${target} VISIBILITY ${visibility}
96-
CXX -Wunreachable-code
97-
)
93+
check_and_add_warnings(TARGET ${target} VISIBILITY ${visibility} CXX -Wunreachable-code)
9894
elseif(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang")
9995
# Wrong warnings for std::array until clang 6
10096
target_compile_options(${target} ${visibility} -Wno-missing-braces)
10197
endif()
98+
if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang" OR (CMAKE_CXX_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.0))
99+
# To many false positives until clang 10 fixed them
100+
check_and_add_warnings(TARGET ${target} VISIBILITY ${visibility} CXX -Wno-range-loop-analysis)
101+
endif()
102102
# Not used:
103103
#-Wpadded
104104
#-Wstack-protector

0 commit comments

Comments
 (0)