From e2d1190b9ea09c54e5d7373643d62e2034bc1531 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 27 May 2020 11:27:26 -0400 Subject: [PATCH] Fix: incorrect specifier %lu used with size_t argument MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fixes the following warning on 32-bit targets: libtool: compile: gcc -DHAVE_CONFIG_H -I../../../include -I../../../include -I../../../src -include config.h -I/build/include -I/home/jenkins/workspace/lttng-tools_master_portbuild/arch/armhf/babeltrace_version/stable-1.5/build/std/conf/std/liburcu_version/master/test_type/base/deps/build/include -Wall -Wno-incomplete-setjmp-declaration -Wdiscarded-qualifiers -Wmissing-declarations -Wmissing-prototypes -Wmissing-parameter-type -fno-strict-aliasing -pthread -g -O2 -MT consumer-stream.lo -MD -MP -MF .deps/consumer-stream.Tpo -c consumer-stream.c -fPIC -DPIC -o .libs/consumer-stream.o In file included from ../../../src/common/common.h:12:0, from consumer.c:25: consumer.c: In function ‘lttng_consumer_on_read_subbuffer_mmap’: ../../../src/common/error.h:161:35: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘size_t {aka 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) ^~~~~~~ consumer.c:1688:2: note: in expansion of macro ‘DBG’ DBG("Consumer mmap write() ret %zd (len %lu)", ret, write_len); ^~~ Signed-off-by: Jérémie Galarneau Change-Id: Id9a571d8e94105428833baa053c6463b91484a03 --- src/common/consumer/consumer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 52b15867b..50951fd28 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -1685,7 +1685,7 @@ ssize_t lttng_consumer_on_read_subbuffer_mmap( * receive a ret value that is bigger than len. */ ret = lttng_write(outfd, buffer->data, write_len); - DBG("Consumer mmap write() ret %zd (len %lu)", ret, write_len); + DBG("Consumer mmap write() ret %zd (len %zu)", ret, write_len); if (ret < 0 || ((size_t) ret != write_len)) { /* * Report error to caller if nothing was written else at least send the -- 2.34.1