From db0763aaa495f1f6fe8bd6d07f859de647de761a Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 1 Jul 2021 22:11:20 +0800 Subject: [PATCH] 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 --- src/mds/cephfs_features.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mds/cephfs_features.cc b/src/mds/cephfs_features.cc index deec59a286045..eb5271c1ba846 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)); } }