From d67ba3e434d72e884a459e662496c0b9a6ac5f17 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 23 Feb 2015 21:35:20 +0000 Subject: [PATCH] Fix compilation warnings about incompatible print formats On some platforms printing of __s64 types with "%lld" format, or __u64 types with "%llu" or "%llx" formats causes a warning that __s64/__u64 type is not compatible with long long format. From my PoV, this is nonsense, but the workaround costs nothing. * scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Cast __u64 types to (unsigned long long). * v4l2.c (v4l2_ioctl): Likewise. Cast __s64 type to (long long). --- scsi.c | 6 +++--- v4l2.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scsi.c b/scsi.c index 81737ab7..867b74c0 100644 --- a/scsi.c +++ b/scsi.c @@ -155,7 +155,7 @@ print_sg_io_v4_req(struct tcb *tcp, long arg) printxval(bsg_subprotocol, sg_io.subprotocol, "BSG_SUB_PROTOCOL_???"); tprintf(", request[%u]=", sg_io.request_len); print_sg_io_buffer(tcp, sg_io.request, sg_io.request_len); - tprintf(", request_tag=%llu", sg_io.request_tag); + tprintf(", request_tag=%llu", (unsigned long long) sg_io.request_tag); tprintf(", request_attr=%u", sg_io.request_attr); tprintf(", request_priority=%u", sg_io.request_priority); tprintf(", request_extra=%u", sg_io.request_extra); @@ -167,7 +167,7 @@ print_sg_io_v4_req(struct tcb *tcp, long arg) tprintf(", din_xfer_len=%u", sg_io.din_xfer_len); tprintf(", timeout=%u", sg_io.timeout); tprintf(", flags=%u", sg_io.flags); - tprintf(", usr_ptr=%llu", sg_io.usr_ptr); + tprintf(", usr_ptr=%llu", (unsigned long long) sg_io.usr_ptr); tprintf(", spare_in=%u", sg_io.spare_in); tprintf(", dout[%u]=", sg_io.dout_xfer_len); if (sg_io.dout_iovec_count) @@ -208,7 +208,7 @@ print_sg_io_v4_res(struct tcb *tcp, long arg) tprintf(", response_len=%u", sg_io.response_len); tprintf(", din_resid=%u", sg_io.din_resid); tprintf(", dout_resid=%u", sg_io.dout_resid); - tprintf(", generated_tag=%llu", sg_io.generated_tag); + tprintf(", generated_tag=%llu", (unsigned long long) sg_io.generated_tag); tprintf(", spare_out=%u", sg_io.spare_out); } diff --git a/v4l2.c b/v4l2.c index 69ff6186..88b0532f 100644 --- a/v4l2.c +++ b/v4l2.c @@ -446,8 +446,8 @@ v4l2_ioctl(struct tcb *tcp, const unsigned int code, long arg) # endif { if (must_print_values) { - tprintf(", value=%i, value64=%lli", ctrl.value, - ctrl.value64); + tprintf(", value=%i, value64=%lld", ctrl.value, + (long long) ctrl.value64); } } tprints("}"); @@ -487,7 +487,7 @@ v4l2_ioctl(struct tcb *tcp, const unsigned int code, long arg) if (umove(tcp, arg, &s) < 0) return 0; if ((code == VIDIOC_S_STD) == entering(tcp)) - tprintf(", std=%#llx", s); + tprintf(", std=%#llx", (unsigned long long) s); return 1; } -- 2.40.0