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
F170646956: D11678.diff
Sat, Sep 5, 7:24 PM
F170646881: D11678.diff
Sat, Sep 5, 7:24 PM
F170592401: D11678.diff
Sat, Sep 5, 1:33 PM
F170543658: D11678.id.diff
Sat, Sep 5, 8:12 AM
Unknown Object (File)
Thu, Sep 3, 6:46 AM
Unknown Object (File)
Tue, Sep 1, 12:09 PM
Unknown Object (File)
Tue, Sep 1, 7:07 AM
Unknown Object (File)
Tue, Sep 1, 5:25 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 Not Applicable
Unit
Tests Not Applicable