From 6ae9091ab051a64a50678190a9c8f4d92b70933a Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 1 May 2021 22:05:25 -0400 Subject: [PATCH] sim: cgen: tweak cgen_rtx_error to fix warnings The function was missing a prototype, and passing a constant string as the format string instead of going through a %s format. --- sim/common/ChangeLog | 5 +++++ sim/common/cgen-ops.h | 2 ++ sim/common/cgen-utils.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 0795a701c01..a3f6f38d7df 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,3 +1,8 @@ +2021-05-08 Mike Frysinger + + * cgen-ops.h (cgen_rtx_error): Declare. + * cgen-utils.c (cgen_rtx_error): Add %s printf argument. + 2021-05-08 Mike Frysinger * cgen-utils.c (virtual_insn_entries): Change {0} to {}. diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h index 329d7de285a..86a483528a3 100644 --- a/sim/common/cgen-ops.h +++ b/sim/common/cgen-ops.h @@ -708,4 +708,6 @@ BI SUBOFDI (DI a, DI b, BI c); #endif +extern void cgen_rtx_error (SIM_CPU *, const char *); + #endif /* CGEN_SEM_OPS_H */ diff --git a/sim/common/cgen-utils.c b/sim/common/cgen-utils.c index a22caabbbd8..a430427bf12 100644 --- a/sim/common/cgen-utils.c +++ b/sim/common/cgen-utils.c @@ -416,7 +416,7 @@ cgen_rtx_error (SIM_CPU *cpu, const char * msg) { SIM_DESC sd = CPU_STATE (cpu); - sim_io_printf (sd, msg); + sim_io_printf (sd, "%s", msg); sim_io_printf (sd, "\n"); sim_engine_halt (sd, cpu, NULL, CPU_PC_GET (cpu), sim_stopped, SIM_SIGTRAP); -- 2.30.2