All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matheus Tavares Bernardino <quic_mathbern@quicinc.com>
To: qemu-devel@nongnu.org
Cc: tsimpson@quicinc.com, bcain@quicinc.com, quic_mliebel@quicinc.com
Subject: [PATCH 2/2] Hexagon (tests/.../hex_test.h): use portable printf formats
Date: Tue, 30 May 2023 10:45:08 -0300	[thread overview]
Message-ID: <a4a98ae4b091b02946e5a95801cb19aceb36f20c.1685454251.git.quic_mathbern@quicinc.com> (raw)
In-Reply-To: <cover.1685454251.git.quic_mathbern@quicinc.com>

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



      parent reply	other threads:[~2023-05-30 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-30 13:45 [PATCH 0/2] Hexagon tests: fix test_load_tmp2 and non-portable format Matheus Tavares Bernardino
2023-05-30 13:45 ` [PATCH 1/2] Hexagon (hvx_misc test): fix uninitialized regs at test_load_tmp2 Matheus Tavares Bernardino
2023-05-30 13:45 ` Matheus Tavares Bernardino [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a4a98ae4b091b02946e5a95801cb19aceb36f20c.1685454251.git.quic_mathbern@quicinc.com \
    --to=quic_mathbern@quicinc.com \
    --cc=bcain@quicinc.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quic_mliebel@quicinc.com \
    --cc=tsimpson@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.