diff options
author | Ruediger Meier | 2016-02-09 18:08:56 +0100 |
---|---|---|
committer | Ruediger Meier | 2016-02-11 13:39:56 +0100 |
commit | 7231fb2a5b0b0ebf2be047a23a11ca43e786861b (patch) | |
tree | 2467d1d110e0699a65a36636e173a132e1233751 /libuuid | |
parent | include: add missing includes (diff) | |
download | kernel-qcow2-util-linux-7231fb2a5b0b0ebf2be047a23a11ca43e786861b.tar.gz kernel-qcow2-util-linux-7231fb2a5b0b0ebf2be047a23a11ca43e786861b.tar.xz kernel-qcow2-util-linux-7231fb2a5b0b0ebf2be047a23a11ca43e786861b.zip |
misc: fix some printf format strings
Fix the warnings below for OSX clang and add a few more
casts for timeval:
lib/at.c:131:27: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'off_t' (aka 'long long') [-Wformat]
printf("%16jd bytes ", st.st_size);
~~~~~ ^~~~~~~~~~
lib/strutils.c:522:52: warning: format specifies type 'intmax_t' (aka 'long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
snprintf(buf, sizeof(buf), "%d%s%jd%s", dec, dp, frac, suffix);
~~~ ^~~~
lib/sysfs.c:468:42: warning: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Wformat]
len = snprintf(buf, sizeof(buf), "%ju", num);
~~~ ^~~
libuuid/src/gen_uuid.c:316:34: warning: format specifies type 'unsigned long' but the argument has type '__darwin_suseconds_t' (aka 'int') [-Wformat]
clock_seq, last.tv_sec, last.tv_usec, adjustment);
^~~~~~~~~~~~
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'libuuid')
-rw-r--r-- | libuuid/src/gen_uuid.c | 4 | ||||
-rw-r--r-- | libuuid/src/uuid_time.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libuuid/src/gen_uuid.c b/libuuid/src/gen_uuid.c index 4d6099720..f9a937cf5 100644 --- a/libuuid/src/gen_uuid.c +++ b/libuuid/src/gen_uuid.c @@ -312,8 +312,8 @@ try_again: if (state_fd >= 0) { rewind(state_f); len = fprintf(state_f, - "clock: %04x tv: %016lu %08lu adj: %08d\n", - clock_seq, last.tv_sec, last.tv_usec, adjustment); + "clock: %04x tv: %016ld %08ld adj: %08d\n", + clock_seq, (long)last.tv_sec, (long)last.tv_usec, adjustment); fflush(state_f); if (ftruncate(state_fd, len) < 0) { fprintf(state_f, " \n"); diff --git a/libuuid/src/uuid_time.c b/libuuid/src/uuid_time.c index f25f5c90f..6991ecd53 100644 --- a/libuuid/src/uuid_time.c +++ b/libuuid/src/uuid_time.c @@ -163,7 +163,7 @@ main(int argc, char **argv) printf("Warning: not a time-based UUID, so UUID time " "decoding will likely not work!\n"); } - printf("UUID time is: (%ld, %ld): %s\n", tv.tv_sec, tv.tv_usec, + printf("UUID time is: (%ld, %ld): %s\n", (long)tv.tv_sec, (long)tv.tv_usec, ctime(&time_reg)); return 0; |