aboutsummaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2021-02-01 11:12:56 +0000
committerAndrew Burgess <andrew.burgess@embecosm.com>2021-02-08 11:01:07 +0000
commitb9fe995797542ac6a2bd05c1864eeb53dbfdebf7 (patch)
treec7557b6bb2ab942a9f1c3b49b06412b8426c37c8 /sim
parent4b426396368fd250a502a9c547da7143af4afbe0 (diff)
downloadgdb-b9fe995797542ac6a2bd05c1864eeb53dbfdebf7.zip
gdb-b9fe995797542ac6a2bd05c1864eeb53dbfdebf7.tar.gz
gdb-b9fe995797542ac6a2bd05c1864eeb53dbfdebf7.tar.bz2
sim/rx: provide a format string for printf
Calling printf with the format being a non constant string results in a GCC warning: warning: format not a string literal and no format arguments [-Wformat-nonliteral] Provide a constant format string to printf in the few places this warning is triggered. sim/rx/ChangeLog: * reg.c (fpsw2str): Provide a format string to printf. (trace_register_changes): Likewise.
Diffstat (limited to 'sim')
-rw-r--r--sim/rx/ChangeLog5
-rw-r--r--sim/rx/reg.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog
index b899269..320d164 100644
--- a/sim/rx/ChangeLog
+++ b/sim/rx/ChangeLog
@@ -1,5 +1,10 @@
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
+ * reg.c (fpsw2str): Provide a format string to printf.
+ (trace_register_changes): Likewise.
+
+2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
+
* err.c (execution_error_exit_all): Delete.
2021-02-08 Andrew Burgess <andrew.burgess@embecosm.com>
diff --git a/sim/rx/reg.c b/sim/rx/reg.c
index 00796a0..ce9be12 100644
--- a/sim/rx/reg.c
+++ b/sim/rx/reg.c
@@ -509,7 +509,7 @@ fpsw2str(int rpsw)
#define TRC(f,n) \
if (oldregs.f != regs.f) \
{ \
- if (tag) { printf (tag); tag = 0; } \
+ if (tag) { printf ("%s", tag); tag = 0; } \
printf(" %s %08x:%08x", n, \
(unsigned int)oldregs.f, \
(unsigned int)regs.f); \
@@ -531,7 +531,7 @@ trace_register_changes (void)
TRC (r_isp, "isp");
if (oldregs.r_psw != regs.r_psw)
{
- if (tag) { printf (tag); tag = 0; }
+ if (tag) { printf ("%s", tag); tag = 0; }
printf(" psw %s:", psw2str(oldregs.r_psw));
printf("%s", psw2str(regs.r_psw));
oldregs.r_psw = regs.r_psw;
@@ -539,7 +539,7 @@ trace_register_changes (void)
if (oldregs.r_fpsw != regs.r_fpsw)
{
- if (tag) { printf (tag); tag = 0; }
+ if (tag) { printf ("%s", tag); tag = 0; }
printf(" fpsw %s:", fpsw2str(oldregs.r_fpsw));
printf("%s", fpsw2str(regs.r_fpsw));
oldregs.r_fpsw = regs.r_fpsw;
@@ -547,7 +547,7 @@ trace_register_changes (void)
if (oldregs.r_acc != regs.r_acc)
{
- if (tag) { printf (tag); tag = 0; }
+ if (tag) { printf ("%s", tag); tag = 0; }
printf(" acc %016llx:", oldregs.r_acc);
printf("%016llx", regs.r_acc);
oldregs.r_acc = regs.r_acc;