Multiple printf() size fixes (#17199)

cmd/zinject/zinject.c:
 - use PRIu64 when printing uint64_t

tests/zfs-tests/cmd/clonefile.c:
 - use an unsigned long long to store result from strtoull()
 - use %jd for printing off_t, %zu for size_t, %zd for ssize_t

tests/zfs-tests/tests/functional/vdev_disk/page_alignment.c:
 - use %zx to print size_t

Discovered when compiling on FreeBSD i386.

Signed-off-by: Martin Matuska <mm@FreeBSD.org>

Reviewed-by: Rob Norris <robn@despairlabs.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Allan Jude <allan@klarasystems.com>
Reviewed-by: @ImAwsumm
This commit is contained in:
Martin Matuška
2025-04-02 00:27:03 +02:00
committed by GitHub
parent 301da593ad
commit 87f8bf6b0c
3 changed files with 17 additions and 11 deletions
@@ -421,14 +421,14 @@ run_test(const page_test_t *test, bool verbose)
size_t take = MIN(rem, len);
if (verbose)
printf(" page %d [off %lx len %lx], "
"rem %lx, take %lx\n",
printf(" page %d [off %zx len %zx], "
"rem %zx, take %zx\n",
i, off, len, rem, take);
if (vdev_disk_check_alignment_cb(NULL, off, take, &s)) {
if (verbose)
printf(" ABORT: misalignment detected, "
"rem %lx\n", rem);
"rem %zx\n", rem);
return (false);
}
@@ -439,7 +439,7 @@ run_test(const page_test_t *test, bool verbose)
if (rem > 0) {
if (verbose)
printf(" ABORT: ran out of pages, rem %lx\n", rem);
printf(" ABORT: ran out of pages, rem %zx\n", rem);
return (false);
}