]> git.ipfire.org Git - thirdparty/systemd.git/commit
Print ssize_t as %zd
authorLuca Boccassi <bluca@debian.org>
Sat, 8 Jul 2023 15:21:37 +0000 (16:21 +0100)
committerLuca Boccassi <bluca@debian.org>
Mon, 10 Jul 2023 09:57:16 +0000 (10:57 +0100)
commitf692c4a6cf41b95b083df17c38ba883eb67d1710
tree785728be47f59a5c740c8ad11a22ef8855039894
parente1819eb062241c3c565f6fb7f4ec067e06bc55bd
Print ssize_t as %zd

On some architectures (x32) ssize_t is int, not long int.

../src/basic/confidential-virt.c: In function ‘msr’:
../src/basic/confidential-virt.c:133:27: error: format ‘%ld’ expects argument of type ‘long int’, but argument 7 has type ‘ssize_t’ {aka ‘int’} [-Werror=format=]
  133 |                 log_debug("Short read %ld bytes from MSR device %s (index %" PRIu64 "), ignoring",
      |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  134 |                           rv,
      |                           ~~
      |                           |
      |                           ssize_t {aka int}
../src/basic/log.h:214:86: note: in definition of macro ‘log_full_errno_zerook’
  214 |                         ? log_internal(_level, _e, PROJECT_FILE, __LINE__, __func__, __VA_ARGS__) \
      |                                                                                      ^~~~~~~~~~~
../src/basic/log.h:242:28: note: in expansion of macro ‘log_full’
  242 | #define log_debug(...)     log_full(LOG_DEBUG,   __VA_ARGS__)
      |                            ^~~~~~~~
../src/basic/confidential-virt.c:133:17: note: in expansion of macro ‘log_debug’
  133 |                 log_debug("Short read %ld bytes from MSR device %s (index %" PRIu64 "), ignoring",
      |                 ^~~~~~~~~
../src/basic/confidential-virt.c:133:41: note: format string is defined here
  133 |                 log_debug("Short read %ld bytes from MSR device %s (index %" PRIu64 "), ignoring",
      |                                       ~~^
      |                                         |
      |                                         long int
      |                                       %d
src/basic/confidential-virt.c