From cfa1e2c2761271e12a16f979f6db6376f4fff7ff Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 17 Jul 2020 14:26:17 -0400 Subject: [PATCH 1/1] Fix: relayd: wrong specifier used in DBG format string MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit `len` is of type uint64_t while the format string specifies a size of `%zd`. This results in a warning on most 32-bit architectures. In file included from ../../../src/common/common.h:12:0, from live.c:33: live.c: In function `viewer_get_metadata`: ../../../src/common/error.h:161:35: warning: format `%zd` expects argument of type `signed size_t`, but argument 6 has type `uint64_t {aka long long unsigned int}` [-Wformat=] #define DBG(fmt, args...) _ERRMSG("DEBUG1", PRINT_DBG, fmt, ## args) ^ ../../../src/common/error.h:136:51: note: in definition of macro `__lttng_print` fprintf((type) == PRINT_MSG ? stdout : stderr, fmt, ## args); \ ^~~ ../../../src/common/error.h:161:27: note: in expansion of macro `_ERRMSG` #define DBG(fmt, args...) _ERRMSG("DEBUG1", PRINT_DBG, fmt, ## args) ^~~~~~~ live.c:2051:4: note: in expansion of macro `DBG` DBG("Failed to read metadata: requested = %zd, got = %zd", ^~~ Signed-off-by: Jérémie Galarneau Change-Id: I108191e0a94e712b0596d0d52a21cf8c971d6c1e --- src/bin/lttng-relayd/live.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 9074f24f3..423a97975 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -2048,7 +2048,7 @@ int viewer_get_metadata(struct relay_connection *conn) vstream->stream_file.handle, -read_len, SEEK_CUR); - DBG("Failed to read metadata: requested = %zd, got = %zd", + DBG("Failed to read metadata: requested = %" PRIu64 ", got = %zd", len, read_len); read_len = 0; len = 0; -- 2.34.1