From 020787a93f997f4fd2e16818e73d030b3ef4e4e8 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 6 Sep 2016 16:13:25 +0200 Subject: build: correctly format some (s)size_t messages On 32-bit builds the are are warnings like these: posix.c:6438: warning: format '%ld' expects type 'long int', but argument 11 has type 'ssize_t' Instead of using "%l" for (signed) size_t variables, "%z" should be used. Cherry picked from commit 3af889f02722f4636d2ea30570de6477e8b5a3a9: > BUG: 1198849 > Change-Id: I6f57b5e8ea174dd9e3056aff5da685e497894ccf > Signed-off-by: Niels de Vos > Reviewed-on: http://review.gluster.org/14933 > NetBSD-regression: NetBSD Build System > CentOS-regression: Gluster Build System > Reviewed-by: Kaleb KEITHLEY > Smoke: Gluster Build System This patch is not really recommended for backporting, but we do have a new smoke test that fails when these warnings pop-up. It is cleaner to correct the code in the release-3.7 branch then to modify the smoke test to skip this branch. Change-Id: I6f57b5e8ea174dd9e3056aff5da685e497894ccf BUG: 1373530 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/15410 Reviewed-by: Kaleb KEITHLEY Smoke: Gluster Build System NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System --- xlators/storage/posix/src/posix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/storage') diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index 5295697cc94..cecf5dcb66d 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -6449,8 +6449,8 @@ posix_rchecksum (call_frame_t *frame, xlator_t *this, if (bytes_read < 0) { gf_msg (this->name, GF_LOG_WARNING, errno, P_MSG_PREAD_FAILED, - "pread of %d bytes returned %ld ", - len, bytes_read); + "pread of %d bytes returned %zd", len, + bytes_read); op_errno = errno; } -- cgit