[PATCH/committed 4/4] sim: m68hc11: fix printf size warnings

Mike Frysinger vapier@gentoo.org
Sat Jan 30 18:40:16 GMT 2021


GCC complains %llu is wrong for signed64, so switch to PRIi64.
---
 sim/m68hc11/ChangeLog       | 4 ++++
 sim/m68hc11/dv-m68hc11tim.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/sim/m68hc11/ChangeLog b/sim/m68hc11/ChangeLog
index e83e11ebb70b..0063e8e8b464 100644
--- a/sim/m68hc11/ChangeLog
+++ b/sim/m68hc11/ChangeLog
@@ -1,3 +1,7 @@
+2021-01-30  Mike Frysinger  <vapier@gentoo.org>
+
+	* dv-m68hc11tim.c (cycle_to_string): Change llu to PRIi64.
+
 2021-01-30  Mike Frysinger  <vapier@gentoo.org>
 
 	* m68hc11_sim.c (cpu_set_sp): Add static markings.
diff --git a/sim/m68hc11/dv-m68hc11tim.c b/sim/m68hc11/dv-m68hc11tim.c
index b0d032e19ae5..cd8274ffc34f 100644
--- a/sim/m68hc11/dv-m68hc11tim.c
+++ b/sim/m68hc11/dv-m68hc11tim.c
@@ -503,7 +503,7 @@ cycle_to_string (sim_cpu *cpu, signed64 t, int flags)
   if (t < LONG_MAX)
     sprintf (buf, "%9lu%s%s", (unsigned long) t, cycle_buf, time_buf);
   else
-    sprintf (buf, "%llu%s%s", t, cycle_buf, time_buf);
+    sprintf (buf, "%" PRIi64 "%s%s", t, cycle_buf, time_buf);
   return buf;
 }
 
-- 
2.30.0



More information about the Gdb-patches mailing list