public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Use PRIx64 to print 64bit hex values in legacy_hash
@ 2021-06-03 21:01 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2021-06-03 21:01 UTC (permalink / raw)
  To: gcc-rust

	* gcc/rust/backend/rust-compile.cc (legacy_hash): lo and hi are uint64_t use
	PRIx64 to print them as hex values instead of %lx which is target specific.
---
 gcc/rust/backend/rust-compile.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/rust/backend/rust-compile.cc b/gcc/rust/backend/rust-compile.cc
index 480afc8b72b..ea21ad3f92b 100644
--- a/gcc/rust/backend/rust-compile.cc
+++ b/gcc/rust/backend/rust-compile.cc
@@ -442,7 +442,7 @@ legacy_hash (const std::string &fingerprint)
 
   char hex[16 + 1];
   memset (hex, 0, sizeof hex);
-  snprintf (hex, sizeof hex, "%08lx%08lx", lo, hi);
+  snprintf (hex, sizeof hex, "%08" PRIx64 "%08" PRIx64, lo, hi);
 
   return "h" + std::string (hex, sizeof (hex) - 1);
 }
-- 
2.32.0.rc0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-03 21:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-03 21:01 [PATCH] Use PRIx64 to print 64bit hex values in legacy_hash Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).