-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Multiple printf() size fixes #17199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple printf() size fixes #17199
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me (and til %j
). Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"error: commit message body contains line over 72 characters", plus below:
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 <[email protected]>
@@ -491,7 +492,8 @@ print_device_handler(int id, const char *pool, zinject_record_t *record, | |||
(((double)record->zi_freq) / ZI_PERCENTAGE_MAX) * 100.0f; | |||
|
|||
(void) printf("%3d %-15s %llx %-5s %-10s %8.4f%% " | |||
"%6lu %6lu\n", id, pool, (u_longlong_t)record->zi_guid, | |||
"%6" PRIu64 " %6" PRIu64 "\n", id, pool, | |||
(u_longlong_t)record->zi_guid, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should zi_guid
not also be a PRIu64? and zi_objset
and zi_object
above?
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 <[email protected]> Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: @ImAwsumm (cherry picked from commit 87f8bf6)
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 <[email protected]> Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: @ImAwsumm
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 <[email protected]> Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: @ImAwsumm
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 <[email protected]> Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: @ImAwsumm
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 <[email protected]> Reviewed-by: Rob Norris <[email protected]> Reviewed-by: Alexander Motin <[email protected]> Reviewed-by: Allan Jude <[email protected]> Reviewed-by: @ImAwsumm
Motivation and Context
When compiling on i386, multiple printf() calls incorrectly size variables
Description
cmd/zinject/zinject.c:
tests/zfs-tests/cmd/clonefile.c:
tests/zfs-tests/tests/functional/vdev_disk/page_alignment.c:
How Has This Been Tested?
Tested compiling on Linux amd64, FreeBSD amd64 and FreeBSD i386
Types of changes
Checklist:
Signed-off-by
.