From: Kefu Chai Date: Thu, 1 Jul 2021 14:11:20 +0000 (+0800) Subject: mds/cephfs_features: print size_t using "%zu" X-Git-Tag: v17.1.0~1470^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=db0763aaa495f1f6fe8bd6d07f859de647de761a;p=ceph.git mds/cephfs_features: print size_t using "%zu" 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 --- diff --git a/src/mds/cephfs_features.cc b/src/mds/cephfs_features.cc index deec59a28604..eb5271c1ba84 100644 --- a/src/mds/cephfs_features.cc +++ b/src/mds/cephfs_features.cc @@ -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)); } }