From: Kefu Chai Date: Wed, 9 Sep 2020 03:26:58 +0000 (+0800) Subject: crimson/os: cast pointers to void* before printing them X-Git-Tag: v16.1.0~1157^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2fa982eabcfe4502e1cce2a16eb5e4a5c545390b;p=ceph.git crimson/os: cast pointers to void* before printing them to address the FTBFS like: ../src/crimson/os/seastore/lba_manager/btree/btree_range_pin.cc:110:14: required from here /usr/include/fmt/core.h:902:19: error: static assertion failed: formatting of non-void pointers is disallowed 902 | static_assert(!sizeof(T), "formatting of non-void pointers is disallowed"); | ^~~~~~~~~~ Signed-off-by: Kefu Chai --- diff --git a/src/crimson/os/seastore/lba_manager/btree/btree_range_pin.cc b/src/crimson/os/seastore/lba_manager/btree/btree_range_pin.cc index 96308a91337f..38edff530f9e 100644 --- a/src/crimson/os/seastore/lba_manager/btree/btree_range_pin.cc +++ b/src/crimson/os/seastore/lba_manager/btree/btree_range_pin.cc @@ -102,10 +102,12 @@ void btree_pin_set_t::add_pin(btree_range_pin_t &pin) auto *parent = maybe_get_parent(pin.range); assert(parent); if (!parent->has_ref()) { - logger().debug("{}: acquiring parent {}", __func__, parent); + logger().debug("{}: acquiring parent {}", __func__, + static_cast(parent)); parent->acquire_ref(); } else { - logger().debug("{}: parent has ref {}", __func__, parent); + logger().debug("{}: parent has ref {}", __func__, + static_cast(parent)); } } if (maybe_get_first_child(pin.range) != nullptr) { diff --git a/src/test/crimson/test_messenger.cc b/src/test/crimson/test_messenger.cc index 43a0e688ee4b..5a826b591e23 100644 --- a/src/test/crimson/test_messenger.cc +++ b/src/test/crimson/test_messenger.cc @@ -599,7 +599,7 @@ struct ConnResult { " cnt_accept_dispatched: {}\n" " cnt_reset_dispatched: {}\n" " cnt_remote_reset_dispatched: {}\n", - this, + static_cast(this), index, *conn, state, connect_attempts,