From: Kefu Chai Date: Fri, 9 Oct 2020 07:54:35 +0000 (+0800) Subject: cls/fifo: cast ceph_le64 to uint64_t before printing it X-Git-Tag: v16.1.0~862^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=56a4ba77d695eec04528e11f7b6e672742ef378c;p=ceph.git cls/fifo: cast ceph_le64 to uint64_t before printing it 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 --- diff --git a/src/cls/fifo/cls_fifo.cc b/src/cls/fifo/cls_fifo.cc index 599970f6df11..685d97f048a8 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);