[PATCH/committed] sim: cgen-trace: tweak printf call

Mike Frysinger vapier@gentoo.org
Sun Jan 31 22:32:44 GMT 2021


GCC warns that we pass a non-string literal as the format string,
so add an explicit "%s" to make it happy.
---
 sim/common/ChangeLog    | 4 ++++
 sim/common/cgen-trace.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 12c00f087c83..6b07d2ff51d4 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,7 @@
+2021-01-31  Mike Frysinger  <vapier@gentoo.org>
+
+	* cgen-trace.c (cgen_trace_insn): Add "%s" argument.
+
 2021-01-31  Stafford Horne  <shorne@gmail.com>
 
 	* cgen-accfp.c (fixsfsi): Change res from unsigned32 to signed32.
diff --git a/sim/common/cgen-trace.c b/sim/common/cgen-trace.c
index 82abad61b6c8..0f18c502c637 100644
--- a/sim/common/cgen-trace.c
+++ b/sim/common/cgen-trace.c
@@ -169,7 +169,7 @@ cgen_trace_insn (SIM_CPU *cpu, const struct cgen_insn *opcode,
   if (CGEN_INSN_VIRTUAL_P (opcode))
     {
       trace_prefix (CPU_STATE (cpu), cpu, NULL_CIA, pc, 0,
-		    NULL, 0, CGEN_INSN_NAME (opcode));
+		    NULL, 0, "%s", CGEN_INSN_NAME (opcode));
       return;
     }
 
-- 
2.30.0



More information about the Gdb-patches mailing list