diff options
author | Theodore Ts'o <tytso@mit.edu> | 2021-02-11 10:55:21 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-02-11 10:55:21 -0500 |
commit | 33b9a60c366da5df92d9c1b003aedaf1d0e2008a (patch) | |
tree | aade9700c6078483cb10e400114ceb889c29f666 /e2fsck/util.c | |
parent | fb874e6ff42bee3ee327afc2651483b83311b445 (diff) | |
download | e2fsprogs-33b9a60c366da5df92d9c1b003aedaf1d0e2008a.tar.gz |
Fix clang warnings on architectures with a 64-bit long
On most systems where we compile e2fsprogs, the u64 type is an
unsigned long long. However, there are platforms (such as the
PowerPC) where a long 64-bits and so u64 is typedef'ed to be unsigned
long instead of a unsigned long long. Fix this by using explicit
casts in printf statements. For scanf calls, we need to receive the
value into a unsigned long long, and then assign it to a u64, after
doing range checks.
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'e2fsck/util.c')
-rw-r--r-- | e2fsck/util.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/e2fsck/util.c b/e2fsck/util.c index 0a7cafe6..3fe3c988 100644 --- a/e2fsck/util.c +++ b/e2fsck/util.c @@ -771,7 +771,8 @@ void dump_mmp_msg(struct mmp_struct *mmp, const char *fmt, ...) mmp->mmp_check_interval); printf(" mmp_sequence: %08x\n", mmp->mmp_seq); printf(" mmp_update_date: %s", ctime(&t)); - printf(" mmp_update_time: %lld\n", mmp->mmp_time); + printf(" mmp_update_time: %lld\n", + (long long) mmp->mmp_time); printf(" mmp_node_name: %.*s\n", EXT2_LEN_STR(mmp->mmp_nodename)); printf(" mmp_device_name: %.*s\n", |