Merge pull request #14183 from ethereum/temporaryGcc13Fix

Temporary workaround for GCC 13 compiler warnings.
This commit is contained in:
Daniel 2023-05-04 17:20:49 +02:00 committed by GitHub
commit bed4732e95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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)