From: Mike Frysinger Date: Sun, 2 May 2021 02:05:25 +0000 (-0400) Subject: sim: cgen: tweak cgen_rtx_error to fix warnings X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ae9091ab051a64a50678190a9c8f4d92b70933a;p=binutils-gdb.git 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. --- 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);