From 5206a724a0a022dab8159a28ddd72d7d30e81c9c Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Mon, 7 Nov 2016 11:46:38 -0500 Subject: coredump: fix format string on 32 bits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from ./src/basic/macro.h:415:0, from ./src/shared/acl-util.h:28, from src/coredump/coredump.c:36: src/coredump/coredump.c: In function ‘submit_coredump’: src/coredump/coredump.c:711:26: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 7 has type ‘uint64_t {aka long long unsigned int}’ [-Wformat=] log_info("The core will not be stored: size %zu is greater than %zu (the configured maximum)", ^ ./src/basic/log.h:175:82: note: in definition of macro ‘log_full_errno’ ? log_internal(_level, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \ ^~~~~~~~~~~ ./src/basic/log.h:183:28: note: in expansion of macro ‘log_full’ #define log_info(...) log_full(LOG_INFO, __VA_ARGS__) ^~~~~~~~ src/coredump/coredump.c:711:17: note: in expansion of macro ‘log_info’ log_info("The core will not be stored: size %zu is greater than %zu (the configured maximum)", ^~~~~~~~ src/coredump/coredump.c:711:26: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 8 has type ‘uint64_t {aka long long unsigned int}’ [-Wformat=] log_info("The core will not be stored: size %zu is greater than %zu (the configured maximum)", ^ ./src/basic/log.h:175:82: note: in definition of macro ‘log_full_errno’ ? log_internal(_level, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \ ^~~~~~~~~~~ ./src/basic/log.h:183:28: note: in expansion of macro ‘log_full’ #define log_info(...) log_full(LOG_INFO, __VA_ARGS__) ^~~~~~~~ src/coredump/coredump.c:711:17: note: in expansion of macro ‘log_info’ log_info("The core will not be stored: size %zu is greater than %zu (the configured maximum)", ^~~~~~~~ src/coredump/coredump.c:741:27: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 7 has type ‘uint64_t {aka long long unsigned int}’ [-Wformat=] log_debug("Not generating stack trace: core size %zu is greater than %zu (the configured maximum)", ^ ./src/basic/log.h:175:82: note: in definition of macro ‘log_full_errno’ ? log_internal(_level, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \ ^~~~~~~~~~~ ./src/basic/log.h:182:28: note: in expansion of macro ‘log_full’ #define log_debug(...) log_full(LOG_DEBUG, __VA_ARGS__) ^~~~~~~~ src/coredump/coredump.c:741:17: note: in expansion of macro ‘log_debug’ log_debug("Not generating stack trace: core size %zu is greater than %zu (the configured maximum)", ^~~~~~~~~ src/coredump/coredump.c:741:27: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 8 has type ‘uint64_t {aka long long unsigned int}’ [-Wformat=] log_debug("Not generating stack trace: core size %zu is greater than %zu (the configured maximum)", ^ ./src/basic/log.h:175:82: note: in definition of macro ‘log_full_errno’ ? log_internal(_level, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \ ^~~~~~~~~~~ ./src/basic/log.h:182:28: note: in expansion of macro ‘log_full’ #define log_debug(...) log_full(LOG_DEBUG, __VA_ARGS__) ^~~~~~~~ src/coredump/coredump.c:741:17: note: in expansion of macro ‘log_debug’ log_debug("Not generating stack trace: core size %zu is greater than %zu (the configured maximum)", ^~~~~~~~~ src/coredump/coredump.c:768:34: warning: format ‘%zu’ expects argument of type ‘size_t’, but argument 7 has type ‘uint64_t {aka long long unsigned int}’ [-Wformat=] log_info("The core will not be stored: size %zu is greater than %zu (the configured maximum)", ^ ./src/basic/log.h:175:82: note: in definition of macro ‘log_full_errno’ ? log_internal(_level, _e, __FILE__, __LINE__, __func__, __VA_ARGS__) \ ^~~~~~~~~~~ ./src/basic/log.h:183:28: note: in expansion of macro ‘log_full’ #define log_info(...) log_full(LOG_INFO, __VA_ARGS__) ^~~~~~~~ src/coredump/coredump.c:768:25: note: in expansion of macro ‘log_info’ log_info("The core will not be stored: size %zu is greater than %zu (the configured maximum)", ^~~~~~~~ --- src/coredump/coredump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/coredump/coredump.c') diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 6bd0e925eb..686218525a 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -708,7 +708,7 @@ static int submit_coredump( coredump_filename = strjoina("COREDUMP_FILENAME=", filename); IOVEC_SET_STRING(iovec[n_iovec++], coredump_filename); } else if (arg_storage == COREDUMP_STORAGE_EXTERNAL) - log_info("The core will not be stored: size %zu is greater than %zu (the configured maximum)", + log_info("The core will not be stored: size %"PRIu64" is greater than %"PRIu64" (the configured maximum)", coredump_size, arg_external_size_max); /* Vacuum again, but exclude the coredump we just created */ @@ -738,7 +738,7 @@ static int submit_coredump( else log_warning_errno(r, "Failed to generate stack trace: %m"); } else - log_debug("Not generating stack trace: core size %zu is greater than %zu (the configured maximum)", + log_debug("Not generating stack trace: core size %"PRIu64" is greater than %"PRIu64" (the configured maximum)", coredump_size, arg_process_size_max); if (!core_message) @@ -765,7 +765,7 @@ log: } else log_warning_errno(r, "Failed to attach the core to the journal entry: %m"); } else - log_info("The core will not be stored: size %zu is greater than %zu (the configured maximum)", + log_info("The core will not be stored: size %"PRIu64" is greater than %"PRIu64" (the configured maximum)", coredump_size, arg_journal_size_max); } -- cgit v1.2.3-54-g00ecf