From: Kefu Chai Date: Sat, 8 May 2021 12:51:19 +0000 (+0800) Subject: os/bluestore: print size_t using %xz X-Git-Tag: v17.1.0~1949^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0eb12bc41819b1e3a11250378b7580c8b45a8483;p=ceph.git os/bluestore: print size_t using %xz we cannot assume that size_t is an alias of "long" Signed-off-by: Kefu Chai --- diff --git a/src/os/bluestore/Allocator.cc b/src/os/bluestore/Allocator.cc index 75f3172ca55..34285454146 100644 --- a/src/os/bluestore/Allocator.cc +++ b/src/os/bluestore/Allocator.cc @@ -81,8 +81,8 @@ public: f->open_object_section("free"); char off_hex[30]; char len_hex[30]; - snprintf(off_hex, sizeof(off_hex) - 1, "0x%lx", off); - snprintf(len_hex, sizeof(len_hex) - 1, "0x%lx", len); + snprintf(off_hex, sizeof(off_hex) - 1, "0x%zx", off); + snprintf(len_hex, sizeof(len_hex) - 1, "0x%zx", len); f->dump_string("offset", off_hex); f->dump_string("length", len_hex); f->close_section();