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)
Sun, Oct 26, 9:06 AM
Unknown Object (File)
Sun, Oct 26, 9:06 AM
Unknown Object (File)
Sun, Oct 26, 9:06 AM
Unknown Object (File)
Sun, Oct 26, 2:26 AM
Unknown Object (File)
Tue, Oct 21, 5:46 AM
Unknown Object (File)
Sun, Oct 19, 6:34 AM
Unknown Object (File)
Thu, Oct 16, 4:56 AM
Unknown Object (File)
Sun, Oct 12, 6:59 AM
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 Passed
Unit
No Test Coverage
Build Status
Buildable 10597
Build 11003: arc lint + arc unit