]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
cls/fifo: cast ceph_le64 to uint64_t before printing it
authorKefu Chai <kchai@redhat.com>
Fri, 9 Oct 2020 07:54:35 +0000 (15:54 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 9 Oct 2020 08:49:17 +0000 (16:49 +0800)
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<long long unsigned int>’} [-Wformat=]
   33 |   cls_log(level, "<cls> %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, "<cls> %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 <kchai@redhat.com>
src/cls/fifo/cls_fifo.cc

index 599970f6df110d619fd50aafb365ddf283603449..685d97f048a8c818c098cf205ffd55b0c3388d0b 100644 (file)
@@ -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);