public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/4] sim: cgen: tweak cgen_rtx_error to fix warnings
Date: Tue,  4 May 2021 22:07:31 -0400	[thread overview]
Message-ID: <20210505020733.11660-2-vapier@gentoo.org> (raw)
In-Reply-To: <20210505020733.11660-1-vapier@gentoo.org>

The function was missing a prototype, and passing a constant string
as the format string instead of going through a %s format.
---
 sim/common/cgen-ops.h   | 2 ++
 sim/common/cgen-utils.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/sim/common/cgen-ops.h b/sim/common/cgen-ops.h
index 329d7de285af..86a483528a33 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 a22caabbbd8e..a430427bf12a 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.31.1


  reply	other threads:[~2021-05-05  2:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05  2:07 [PATCH 1/4] sim: cgen: tweak initializers to avoid warnings Mike Frysinger
2021-05-05  2:07 ` Mike Frysinger [this message]
2021-05-05  2:07 ` [PATCH 3/4] sim: cgen: namespace mode_names a bit Mike Frysinger
2021-05-05  2:07 ` [PATCH 4/4] sim: cgen: tweak trace format Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210505020733.11660-2-vapier@gentoo.org \
    --to=vapier@gentoo.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).