summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuediger Meier2018-05-24 15:52:01 +0200
committerRuediger Meier2018-05-24 16:31:43 +0200
commit333423163be2dd66c8b5b1f7a3faf68bbfcb9bce (patch)
tree88ddf32bf5ed5be88ba1ef31380d6f653e21c4a5
parentcfdisk: use uint64_t to avoid compiler warnings (diff)
downloadkernel-qcow2-util-linux-333423163be2dd66c8b5b1f7a3faf68bbfcb9bce.tar.gz
kernel-qcow2-util-linux-333423163be2dd66c8b5b1f7a3faf68bbfcb9bce.tar.xz
kernel-qcow2-util-linux-333423163be2dd66c8b5b1f7a3faf68bbfcb9bce.zip
cfdisk: fix compiler warnings, follow-up 7085f1e4 (#636)
Seen on OSX 10.13, xcode 9.3. disk-utils/cfdisk.c:1860:45: error: format specifies type 'uintmax_t' (aka 'unsigned long') but the argument has type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat] DBG(UI, ul_debug("get_size (default=%ju)", *res)); ~~~ ^~~~ %llu disk-utils/cfdisk.c:267:60: note: expanded from macro 'DBG' #define DBG(m, x) __UL_DBG(cfdisk, CFDISK_DEBUG_, m, x) ^ ./include/debug.h:67:4: note: expanded from macro '__UL_DBG' x; \ ^ disk-utils/cfdisk.c:1889:25: error: incompatible pointer types passing 'uint64_t *' (aka 'unsigned long long *') to parameter of type 'uintmax_t *' (aka 'unsigned long *') [-Werror,-Wincompatible-pointer-types] rc = parse_size(buf, &user, &pwr); /* parse */ ^~~~~ ./include/strutils.h:15:51: note: passing argument to parameter 'res' here extern int parse_size(const char *str, uintmax_t *res, int *power); ^ 2 errors generated. Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
-rw-r--r--disk-utils/cfdisk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/disk-utils/cfdisk.c b/disk-utils/cfdisk.c
index 099bd1be5..13c8a62df 100644
--- a/disk-utils/cfdisk.c
+++ b/disk-utils/cfdisk.c
@@ -1857,7 +1857,7 @@ static int ui_get_size(struct cfdisk *cf, /* context */
ssize_t rc;
char *dflt = size_to_human_string(0, *res);
- DBG(UI, ul_debug("get_size (default=%ju)", *res));
+ DBG(UI, ul_debug("get_size (default=%"PRIu64")", *res));
ui_clean_info();
@@ -1886,7 +1886,7 @@ static int ui_get_size(struct cfdisk *cf, /* context */
insec = 1;
buf[len - 1] = '\0';
}
- rc = parse_size(buf, &user, &pwr); /* parse */
+ rc = parse_size(buf, (uintmax_t *)&user, &pwr); /* parse */
}
if (rc == 0) {