summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2016-07-16 16:36:22 +0200
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-07-18 13:56:10 -0700
commit1b228d3d489cada1c3c9f5fdbb882e7dbc25a091 (patch)
treeaa4af2a462585a48e7030369e670986f6231dfd5 /xlators
parent5ed781ecf531b7916e51c174426e222dab717fb8 (diff)
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 <inttypes.h> and even some more in "logging.h" from libglusterfs. BUG: 1198849 Change-Id: I63eeb9c8e4d7b292ce0c9333938ca365db0823fc Signed-off-by: Niels de Vos <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/14934 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/read-only/src/worm-helper.c2
1 files changed, 1 insertions, 1 deletions
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: