From: Breno Leitao Date: Mon, 21 Jan 2019 11:31:15 +0000 (-0500) Subject: Fix compilation with GCC-8 X-Git-Tag: v1.8~41^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=dc26bb70d82569730b4ce5c88f22084812a2334d;p=users%2Fsagi%2Fnvme-cli.git Fix compilation with GCC-8 Printf() is being called to print an unsigned long int using the long long identifier. This causes the following error with GCC-8: nvme.c:3056:5: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=] "Invalid value for block size (%llu), must be a power of two\n", ^ nvme.c:3091:6: error: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 3 has type ‘__u64 {aka long unsigned int}’ [-Werror=format=] "LBAF corresponding to block size %llu (LBAF %u) not found\n", Adjusting the printf arguments to print the proper format. Signed-off-by: Breno Leitao --- diff --git a/nvme.c b/nvme.c index 992c6b97..e85834db 100644 --- a/nvme.c +++ b/nvme.c @@ -3053,7 +3053,7 @@ static int format(int argc, char **argv, struct command *cmd, struct plugin *plu if (cfg.bs) { if ((cfg.bs & (~cfg.bs + 1)) != cfg.bs) { fprintf(stderr, - "Invalid value for block size (%llu), must be a power of two\n", + "Invalid value for block size (%lu), must be a power of two\n", cfg.bs); return EINVAL; } @@ -3088,7 +3088,7 @@ static int format(int argc, char **argv, struct command *cmd, struct plugin *plu } if (cfg.lbaf == 0xff) { fprintf(stderr, - "LBAF corresponding to block size %llu (LBAF %u) not found\n", + "LBAF corresponding to block size %lu (LBAF %u) not found\n", cfg.bs, lbads); fprintf(stderr, "Please correct block size, or specify LBAF directly\n");