From 1b228d3d489cada1c3c9f5fdbb882e7dbc25a091 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Sat, 16 Jul 2016 16:36:22 +0200 Subject: build: fix sprintf format for uint64_t in gf_worm_serialize_state() When building on 32-bit architectures, the following warning gets reported: worm-helper.c: In function 'gf_worm_serialize_state': worm-helper.c:219: warning: format '%ld' expects type 'long int', but argument 4 has type 'uint64_t' worm-helper.c:219: warning: format '%ld' expects type 'long int', but argument 5 has type 'uint64_t' The format string "%ld" depend on the architecture. If the type is very specific (here unint64_t), the dynamicness of "%ld" is not correct. There are macros for these fixed types in and even some more in "logging.h" from libglusterfs. BUG: 1198849 Change-Id: I63eeb9c8e4d7b292ce0c9333938ca365db0823fc Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/14934 NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System Reviewed-by: Kaleb KEITHLEY --- xlators/features/read-only/src/worm-helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlators/features/read-only/src/worm-helper.c b/xlators/features/read-only/src/worm-helper.c index 81a167e3c63..61aa4f02651 100644 --- a/xlators/features/read-only/src/worm-helper.c +++ b/xlators/features/read-only/src/worm-helper.c @@ -215,7 +215,7 @@ gf_worm_serialize_state (worm_reten_state_t *reten_state, char *val) state |= reten_state->retain << 1; state |= reten_state->legal_hold << 2; state |= reten_state->ret_mode << 3; - sprintf (val, "%d/%ld/%ld", state, reten_state->ret_period, + sprintf (val, "%d/%"PRIu64"/%"PRIu64, state, reten_state->ret_period, reten_state->auto_commit_period); out: -- cgit