From 56a4ba77d695eec04528e11f7b6e672742ef378c Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Fri, 9 Oct 2020 15:54:35 +0800 Subject: [PATCH] cls/fifo: cast ceph_le64 to uint64_t before printing it MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit silences warning like: ../src/cls/fifo/cls_fifo.cc: In member function ‘int rados::cls::fifo::{anonymous}::EntryReader::get_next_entry(ceph::buffer::v15_2_0::list*, uint64_t*, ceph::real_time*)’: ../src/include/rados/objclass.h:33:18: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 7 has type ‘ceph_le64’ {aka ‘ceph_le’} [-Wformat=] 33 | cls_log(level, " %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__) ../src/include/rados/objclass.h:33:18: note: in definition of macro ‘CLS_LOG’ 33 | cls_log(level, " %s:%d: " fmt, __FILE__, __LINE__, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~ ../src/cls/fifo/cls_fifo.cc:703:48: note: format string is defined here 703 | CLS_LOG(10, "%s():%d: pre_header.pre_size=%llu", __func__, __LINE__, | ~~~^ | | | long long unsigned int Signed-off-by: Kefu Chai --- src/cls/fifo/cls_fifo.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cls/fifo/cls_fifo.cc b/src/cls/fifo/cls_fifo.cc index 599970f6df110..685d97f048a8c 100644 --- a/src/cls/fifo/cls_fifo.cc +++ b/src/cls/fifo/cls_fifo.cc @@ -700,8 +700,8 @@ int EntryReader::get_next_entry(ceph::buffer::list* pbl, *pofs = ofs; } - CLS_LOG(10, "%s():%d: pre_header.pre_size=%llu", __func__, __LINE__, - pre_header.pre_size); + CLS_LOG(10, "%s():%d: pre_header.pre_size=%" PRIu64, __func__, __LINE__, + uint64_t(pre_header.pre_size)); r = seek(pre_header.pre_size); if (r < 0) { CLS_ERR("ERROR: %s(): failed to seek: r=%d", __func__, r); -- 2.39.5