[PATCH] v4l2: Fix compile of mpers-m32 API

Hauke Mehrtens hauke at hauke-m.de
Sat Aug 29 19:42:33 UTC 2020


In the mpers-m32 API the value64 member of the struct_v4l2_ext_control
structure is of type int32_t. This causes the following compile error:
v4l2.c: In function 'print_v4l2_ext_control':
v4l2.c:915:11: error: format '%ld' expects argument of type 'long int', but argument 3 has type 'int32_t' {aka 'const int'} [-Werror=format=]
   tprintf(", value=%d, value64=%" PRId64, p->value, p->value64);
           ^~~~~~~~~~~~~~~~~~~~~~~                   ~~~~~~~~~~

Fix this by adding the explicit cast again which was removed in strace
version 5.6.

Fixes: 7e7669ec899e ("v4l2: always decode VIDIOC_*_EXT_CTRLS ioctl commands")
---
 v4l2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/v4l2.c b/v4l2.c
index 3a1c49d2..93466c4d 100644
--- a/v4l2.c
+++ b/v4l2.c
@@ -912,7 +912,7 @@ print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void *
 		tprints(", string=");
 		printstrn(tcp, ptr_to_kulong(p->string), p->size);
 	} else {
-		tprintf(", value=%d, value64=%" PRId64, p->value, p->value64);
+		tprintf(", value=%d, value64=%" PRId64, p->value, (int64_t) p->value64);
 	}
 	tprints("}");
 
-- 
2.20.1



More information about the Strace-devel mailing list