diff options
author | Niels de Vos <ndevos@redhat.com> | 2016-09-05 16:53:38 +0200 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-09-07 04:49:42 -0700 |
commit | 4f030852e3a4da367a948158cc8cf152e62bcee5 (patch) | |
tree | 15bdab7c8982da7864c9d5c425e9ee1286fdf1fe /xlators | |
parent | 493281caf8398aa74c69fa85e341e4c0e3564017 (diff) |
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 <ndevos@redhat.com>
> Reviewed-on: http://review.gluster.org/14933
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
> Smoke: Gluster Build System <jenkins@build.gluster.org>
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: 1225842
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-on: http://review.gluster.org/15401
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Smoke: Gluster Build System <jenkins@build.gluster.org>
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/debug/trace/src/trace.c | 2 | ||||
-rw-r--r-- | xlators/features/changelog/lib/src/gf-changelog-reborp.c | 2 | ||||
-rw-r--r-- | xlators/features/shard/src/shard.c | 2 | ||||
-rw-r--r-- | xlators/storage/posix/src/posix.c | 4 |
4 files changed, 5 insertions, 5 deletions
diff --git a/xlators/debug/trace/src/trace.c b/xlators/debug/trace/src/trace.c index c809254eb17..03e92184dcd 100644 --- a/xlators/debug/trace/src/trace.c +++ b/xlators/debug/trace/src/trace.c @@ -2300,7 +2300,7 @@ trace_writev (call_frame_t *frame, xlator_t *this, fd_t *fd, snprintf (string, sizeof (string), "%"PRId64": gfid=%s fd=%p, count=%d, " - " offset=%"PRId64" flags=0%x write_size=%lu", + " offset=%"PRId64" flags=0%x write_size=%zu", frame->root->unique, uuid_utoa (fd->inode->gfid), fd, count, offset, flags, total_size); diff --git a/xlators/features/changelog/lib/src/gf-changelog-reborp.c b/xlators/features/changelog/lib/src/gf-changelog-reborp.c index 19c43cc8211..8534bce4b34 100644 --- a/xlators/features/changelog/lib/src/gf-changelog-reborp.c +++ b/xlators/features/changelog/lib/src/gf-changelog-reborp.c @@ -350,7 +350,7 @@ gf_changelog_event_handler (rpcsvc_request_t *req, } gf_log (this->name, GF_LOG_DEBUG, - "seq: %lu [%s] (time: %lu.%lu), (vec: %d, len: %ld)", + "seq: %lu [%s] (time: %lu.%lu), (vec: %d, len: %zd)", rpc_req.seq, entry->brick, rpc_req.tv_sec, rpc_req.tv_usec, payloadcnt, payloadlen); diff --git a/xlators/features/shard/src/shard.c b/xlators/features/shard/src/shard.c index c82fd0a31f1..b8dc5bbf249 100644 --- a/xlators/features/shard/src/shard.c +++ b/xlators/features/shard/src/shard.c @@ -4629,7 +4629,7 @@ shard_common_inode_write_begin (call_frame_t *frame, xlator_t *this, gf_msg_trace (this->name, 0, "%s: gfid=%s first_block=%"PRIu32" " "last_block=%"PRIu32" num_blocks=%"PRIu32" offset=%"PRId64"" - " total_size=%lu flags=%"PRId32"", gf_fop_list[fop], + " total_size=%zu flags=%"PRId32"", gf_fop_list[fop], uuid_utoa (fd->inode->gfid), local->first_block, local->last_block, local->num_blocks, offset, local->total_size, local->flags); diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c index f58cd27473d..b42dda7f009 100644 --- a/xlators/storage/posix/src/posix.c +++ b/xlators/storage/posix/src/posix.c @@ -6387,8 +6387,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; } |