aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-27 21:35:17 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-28 11:26:09 -0400
commitf2ddf6e39d85c3a21f7a88f51dcaf3bbf0ddaab9 (patch)
treed4bba0260beb9946aa4a3c9af34d5385f1750878
parentba4990f13f2ed67bdadd1f087336d37abd212092 (diff)
downloadgdb-f2ddf6e39d85c3a21f7a88f51dcaf3bbf0ddaab9.zip
gdb-f2ddf6e39d85c3a21f7a88f51dcaf3bbf0ddaab9.tar.gz
gdb-f2ddf6e39d85c3a21f7a88f51dcaf3bbf0ddaab9.tar.bz2
sim: bpf: fix printf warnings on 32-bit systems
Use PRI macros to display 64-bit types instead of assuming long is a 64-bit type itself.
-rw-r--r--sim/bpf/ChangeLog4
-rw-r--r--sim/bpf/bpf.c2
2 files changed, 5 insertions, 1 deletions
diff --git a/sim/bpf/ChangeLog b/sim/bpf/ChangeLog
index 912a48a..ce38385 100644
--- a/sim/bpf/ChangeLog
+++ b/sim/bpf/ChangeLog
@@ -1,3 +1,7 @@
+2021-06-28 Mike Frysinger <vapier@gentoo.org>
+
+ * bpf.c (bpfbf_exit): Use PRI 64 formats.
+
2021-06-27 Mike Frysinger <vapier@gentoo.org>
* cpu.c (bpfbf_record_trace_results): Delete function.
diff --git a/sim/bpf/bpf.c b/sim/bpf/bpf.c
index de77da8..4f05738 100644
--- a/sim/bpf/bpf.c
+++ b/sim/bpf/bpf.c
@@ -186,7 +186,7 @@ bpfbf_exit (SIM_CPU *current_cpu)
/* r0 holds "return code" */
DI r0 = GET_H_GPR (0);
- printf ("exit %ld (0x%lx)\n", r0, r0);
+ printf ("exit %" PRId64 " (0x%" PRIx64 ")\n", r0, r0);
sim_engine_halt (sd, current_cpu, NULL, CPU_PC_GET (current_cpu),
sim_exited, 0 /* sigrc */);