Page MenuHomeFreeBSD

Fix printf format warning in zfs_module.c
ClosedPublic

Authored by dim on Jul 20 2017, 7:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 25, 3:05 PM
Unknown Object (File)
Thu, Jun 25, 11:35 AM
Unknown Object (File)
Wed, Jun 24, 9:22 PM
Unknown Object (File)
May 22 2026, 10:28 AM
Unknown Object (File)
May 14 2026, 4:57 PM
Unknown Object (File)
May 14 2026, 11:09 AM
Unknown Object (File)
Apr 30 2026, 12:41 PM
Unknown Object (File)
Apr 27 2026, 3:20 PM
Subscribers

Details

Summary

Clang 5.0.0 got better warnings about print format strings using %zd,
and this leads to the following -Werror warning on arm:

sys/boot/efi/boot1/zfs_module.c:186:18: error: format specifies type 'ssize_t' (aka 'int') but the argument has type 'off_t' (aka 'long long') [-Werror,-Wformat]
                    "(%lu)\n", st.st_size, spa->spa_name, filepath, EFI_ERROR_CODE(status));
                               ^~~~~~~~~~

Fix this by casting off_t arguments to intmax_t, and using %jd
instead.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable