Temporary workaround for GCC 13 compiler warnings.

This commit is contained in:
Daniel Kirchner 2023-05-04 16:09:05 +02:00
parent 385c48df73
commit f2ddc997f0

View File

@ -65,6 +65,19 @@ if (("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" MA
if(WEXTRA_SEMI)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wextra-semi>)
endif()
# TODO: This is a temporary workaround. The underlying warning should be addressed and this workaround removed ASAP.
check_cxx_compiler_flag(-Wno-error=overloaded-virtual=1 WNO_ERROR_OVERLOADED_VIRTUAL)
if (WNO_ERROR_OVERLOADED_VIRTUAL)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-error=overloaded-virtual=1>)
endif()
# TODO: This is a temporary workaround. The underlying warning should be addressed and this workaround removed ASAP.
# Once https://github.com/fmtlib/fmt/issues/3415 is addressed, this can be fixed by bumping the fmtlib version.
check_cxx_compiler_flag(-Wno-error=dangling-reference WNO_ERROR_DANGLING_REFERENCE)
if (WNO_ERROR_DANGLING_REFERENCE)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-error=dangling-reference>)
endif()
eth_add_cxx_compiler_flag_if_supported(-Wfinal-dtor-non-final-class)
eth_add_cxx_compiler_flag_if_supported(-Wnewline-eof)
eth_add_cxx_compiler_flag_if_supported(-Wsuggest-destructor-override)