quite a few base classes with virtual functions mark their destructor
non-virtual and `protected` for better performance, as seastar destruct
them via the concrete type of the instance.
so let's disable this warning. but, please note, this newly added
CXX_FLAG in `Seastar_CXX_FLAGS` won't be populated to crimson, as it is
only added to the CXX_FLAGS used for compiling seastar itself. so we still
have `-Wnon-virtual-dtor` warnings when compiling crimson as long as seastar
headers are included.
so to silence these warnings, we need to add it also to `crimson::cflags`,
probably it's worth trading the noise caused by seastar's optimizations
with the potentially useful warning messages caused by our oversights.
in my case, there are over 300 lines of warnings split by GCC-10, so i
still think it'd be better to add it also to crimson to increase the
signal-to-noise ratio. we can aways remove it every once in a while to
check if we forget to mark the destructor of a base class `virtual`.
Signed-off-by: Kefu Chai <kchai@redhat.com>
build_dpdk(${CMAKE_BINARY_DIR}/src/dpdk)
endif()
endif()
- set(Seastar_CXX_FLAGS "-Wno-error;-Wno-sign-compare;-Wno-attributes;-Wno-pessimizing-move;-Wno-address-of-packed-member" CACHE STRING "" FORCE)
+ set(Seastar_CXX_FLAGS "-Wno-error;-Wno-sign-compare;-Wno-attributes;-Wno-pessimizing-move;-Wno-address-of-packed-member;-Wno-non-virtual-dtor" CACHE STRING "" FORCE)
add_subdirectory(seastar)
# create the directory so cmake won't complain when looking at the imported
# target: Seastar exports this directory created at build-time
endif()
set_target_properties(crimson::cflags PROPERTIES
INTERFACE_COMPILE_DEFINITIONS "${crimson_cflag_definitions}"
+ INTERFACE_COMPILE_OPTIONS "-Wno-non-virtual-dtor"
INTERFACE_LINK_LIBRARIES Seastar::seastar)
set(crimson_common_srcs