Whamcloud - gitweb
LU-12898 utils: %llu mismatch with type __u64 on ppcle64 58/36558/7
authorOlaf Faaland <faaland1@llnl.gov>
Tue, 22 Oct 2019 16:44:51 +0000 (09:44 -0700)
committerOleg Drokin <green@whamcloud.com>
Fri, 3 Jan 2020 00:09:12 +0000 (00:09 +0000)
commit56b4b112a497661de8dbf5a851c7a045d470deff
tree6e23c047f8fe594396c36406c9e7cb7c5a970916
parentf9314d6e9259e6c7683ed614931ab2506356ba88
LU-12898 utils: %llu mismatch with type __u64 on ppcle64

Fix build errors like this one on ppcle64:

BUILDSTDERR: libmount_utils_zfs.c: In function 'zfs_mkfs_opts':
BUILDSTDERR: libmount_utils_zfs.c:573:5: error: format '%llu' expects
argument of type 'long long unsigned int', but argument 4 has type
'__u64' [-Werror=format=]
BUILDSTDERR:      mop->mo_device_kb * 1024);

__u64 was treated as an unsigned long long which breaks the build on
ppc64le, where they are not the same size.

In printf cases, cast to unsigned long long to match the printf format
so the format is compatible with the type and it is guaranteed
not to lose any data.

In the case of sscanf(), replace the call with strtoull() to eliminate
the issue.

Test-Parameters: trivial
Change-Id: I02fd82e0be4d756881c15aa9faedb9b40961661a
Signed-off-by: Olaf Faaland <faaland1@llnl.gov>
Reviewed-on: https://review.whamcloud.com/36558
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
lustre/utils/libmount_utils_zfs.c
lustre/utils/ll_decode_filter_fid.c
lustre/utils/llog_reader.c
lustre/utils/lr_reader.c
lustre/utils/lsnapshot.c
lustre/utils/lustre_lfsck.c