Skip to content

Commit 61f1afe

Browse files
committed
Disable cast-function-type error
Allows compiling with gcc 10.2
1 parent 18cd1b1 commit 61f1afe

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

CMakeLists.txt

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Werror>)
4545
add_compile_options($<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-error=sequence-point>)
4646
add_compile_options($<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-error=strict-overflow>)
4747
add_compile_options($<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-error=logical-not-parentheses>)
48-
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
49-
# this warning was added in gcc 8 https://debarshiray.wordpress.com/2019/04/01/about-wextra-and-wcast-function-type/
50-
51-
add_compile_options($<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-cast-function-type>) #disable warning
52-
# add_compile_options($<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-error=cast-function-type>) #disable errors from warning
53-
endif ()
5448

5549
# Enable warnings
5650
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Wall>)
@@ -59,6 +53,10 @@ add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Wunused-macros>)
5953
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Wno-error=unused-macros>) # Some false positives / only cover current build configuration
6054

6155
# Exclude some warnings
56+
if (CMAKE_COMPILER_IS_GNUCC AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.0)
57+
# this warning was added in gcc 8 https://debarshiray.wordpress.com/2019/04/01/about-wextra-and-wcast-function-type/
58+
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Wno-cast-function-type>)
59+
endif ()
6260
add_compile_options($<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-misleading-indentation>)
6361
add_compile_options($<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-address>)
6462
add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:-Wno-unused-parameter>)

0 commit comments

Comments
 (0)