1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-23 03:05:48 +03:00
aports/community/ceph16/44-gcc-warnings.patch
2022-11-05 02:21:23 +00:00

34 lines
1.5 KiB
Diff

From db0763aaa495f1f6fe8bd6d07f859de647de761a Mon Sep 17 00:00:00 2001
From: Kefu Chai <kchai@redhat.com>
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 <kchai@redhat.com>
---
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));
}
}