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)
Sat, Jan 18, 7:45 AM
Unknown Object (File)
Nov 23 2024, 2:47 PM
Unknown Object (File)
Nov 19 2024, 7:08 PM
Unknown Object (File)
Nov 14 2024, 5:20 PM
Unknown Object (File)
Oct 7 2024, 1:46 PM
Unknown Object (File)
Sep 22 2024, 3:07 AM
Unknown Object (File)
Sep 8 2024, 3:06 PM
Unknown Object (File)
Sep 8 2024, 9: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 Not Applicable
Unit
Tests Not Applicable