]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
cmake: disable -Wnon-virtual-dtor when compiling seastar
authorKefu Chai <kchai@redhat.com>
Thu, 13 Feb 2020 04:32:00 +0000 (12:32 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 13 Feb 2020 06:53:55 +0000 (14:53 +0800)
commit36963dd7ccd50eff2f8b91d97ffb66295a7a6292
treeafe9ea1c6ffc5affe987b598c43298fe39cbe0f0
parent5f05a50bae8bb4889dba0d249ed5fc3a2fcdcfa5
cmake: disable -Wnon-virtual-dtor when compiling seastar

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>
src/CMakeLists.txt
src/crimson/CMakeLists.txt