]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/cephfs_features: print size_t using "%zu"
authorKefu Chai <kchai@redhat.com>
Thu, 1 Jul 2021 14:11:20 +0000 (22:11 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 1 Jul 2021 14:16:13 +0000 (22:16 +0800)
to silence the warning from GCC like:

../src/mds/cephfs_features.cc: In function 'void cephfs_dump_features(ceph::Formatter*, const feature_bitset_t&)':
../src/mds/cephfs_features.cc:71:39: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
   71 |     snprintf(s, sizeof(s), "feature_%lu", i);
      |                                     ~~^   ~
      |                                       |   |
      |                                       |   size_t {aka long long unsigned int}
      |                                       long unsigned int
      |                                     %llu

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mds/cephfs_features.cc

index deec59a286045f0bd8f2a7cffff11aadc6f83a42..eb5271c1ba8467eff9da6582969a17a0d6f53475 100644 (file)
@@ -68,7 +68,7 @@ void cephfs_dump_features(ceph::Formatter *f, const feature_bitset_t& features)
     if (!features.test(i))
       continue;
     char s[18];
-    snprintf(s, sizeof(s), "feature_%lu", i);
+    snprintf(s, sizeof(s), "feature_%zu", i);
     f->dump_string(s, cephfs_feature_name(i));
   }
 }