qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] Hexagon (tests/.../hex_test.h): use portable printf formats


From: Matheus Tavares Bernardino
Subject: [PATCH 2/2] Hexagon (tests/.../hex_test.h): use portable printf formats
Date: Tue, 30 May 2023 10:45:08 -0300

This fixes compiler messages like "warning: format specifies type
'unsigned int' but the argument has type 'uint32_t' (aka 'unsigned
long') [-Wformat]".

Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
---
 tests/tcg/hexagon/hex_test.h | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/tests/tcg/hexagon/hex_test.h b/tests/tcg/hexagon/hex_test.h
index cfed06a58b..fe253b56e5 100644
--- a/tests/tcg/hexagon/hex_test.h
+++ b/tests/tcg/hexagon/hex_test.h
@@ -19,10 +19,13 @@
 #ifndef HEX_TEST_H
 #define HEX_TEST_H
 
+#include <inttypes.h>
+
 static inline void __check32(int line, uint32_t val, uint32_t expect)
 {
     if (val != expect) {
-        printf("ERROR at line %d: 0x%08x != 0x%08x\n", line, val, expect);
+        printf("ERROR at line %d: 0x%08"PRIx32" != 0x%08"PRIx32"\n",
+               line, val, expect);
         err++;
     }
 }
@@ -32,7 +35,8 @@ static inline void __check32(int line, uint32_t val, uint32_t 
expect)
 static inline void __check64(int line, uint64_t val, uint64_t expect)
 {
     if (val != expect) {
-        printf("ERROR at line %d: 0x%016llx != 0x%016llx\n", line, val, 
expect);
+        printf("ERROR at line %d: 0x%016"PRIx64" != 0x%016"PRIx64"\n",
+               line, val, expect);
         err++;
     }
 }
@@ -62,7 +66,8 @@ static inline void __checkp(int line, void *p, void *expect)
 static inline void __check32_ne(int line, uint32_t val, uint32_t expect)
 {
     if (val == expect) {
-        printf("ERROR at line %d: 0x%08x == 0x%08x\n", line, val, expect);
+        printf("ERROR at line %d: 0x%08"PRIx32" == 0x%08"PRIx32"\n",
+               line, val, expect);
         err++;
     }
 }
@@ -72,7 +77,8 @@ static inline void __check32_ne(int line, uint32_t val, 
uint32_t expect)
 static inline void __check64_ne(int line, uint64_t val, uint64_t expect)
 {
     if (val == expect) {
-        printf("ERROR at line %d: 0x%016llx == 0x%016llx\n", line, val, 
expect);
+        printf("ERROR at line %d: 0x%016"PRIx64" == 0x%016"PRIx64"\n",
+               line, val, expect);
         err++;
     }
 }
-- 
2.37.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]