aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-29 21:45:13 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-29 22:33:04 -0400
commitf8261de1b22cc1a72ae18a2300df8b2cf7f027db (patch)
tree1067347704463f1dc68bb72f3a351e8b4c1b522c
parent7f6fa743740e63fa7ecfd35845853ec6814d0500 (diff)
downloadgdb-f8261de1b22cc1a72ae18a2300df8b2cf7f027db.zip
gdb-f8261de1b22cc1a72ae18a2300df8b2cf7f027db.tar.gz
gdb-f8261de1b22cc1a72ae18a2300df8b2cf7f027db.tar.bz2
sim: ppc: fix printf warnings
This code hits some format-zero-length warnings, so hack the code like we did in the common layers.
-rw-r--r--sim/ppc/ChangeLog6
-rw-r--r--sim/ppc/main.c2
-rw-r--r--sim/ppc/sim_calls.c10
3 files changed, 16 insertions, 2 deletions
diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index b41d202..7a23d68 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,9 @@
+2021-06-29 Mike Frysinger <vapier@gentoo.org>
+
+ * main.c (sim_io_error): Add comment
+ * sim_calls.c (sim_io_error): Likewise. Change "" to " ".
+ (error): Likewise.
+
2021-06-20 Mike Frysinger <vapier@gentoo.org>
* Makefile.in (INLINE_CFLAGS): Change to $(SIM_INLINE).
diff --git a/sim/ppc/main.c b/sim/ppc/main.c
index 0c1a070..2d4d7e4 100644
--- a/sim/ppc/main.c
+++ b/sim/ppc/main.c
@@ -214,6 +214,8 @@ sim_io_flush_stdoutput(void)
}
}
+/* Glue to use sim-fpu module. */
+
void
sim_io_error (SIM_DESC sd, const char *msg, ...)
{
diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c
index 14d4d65..ee9d123 100644
--- a/sim/ppc/sim_calls.c
+++ b/sim/ppc/sim_calls.c
@@ -372,6 +372,8 @@ sim_io_flush_stdoutput(void)
}
}
+/* Glue to use sim-fpu module. */
+
void
sim_io_error (SIM_DESC sd, const char *fmt, ...)
{
@@ -379,7 +381,9 @@ sim_io_error (SIM_DESC sd, const char *fmt, ...)
va_start(ap, fmt);
callbacks->evprintf_filtered (callbacks, fmt, ap);
va_end(ap);
- callbacks->error (callbacks, "");
+ /* Printing a space here avoids empty printf compiler warnings. Not ideal,
+ but we want error's side-effect where it halts processing. */
+ callbacks->error (callbacks, " ");
}
/****/
@@ -391,7 +395,9 @@ error (const char *msg, ...)
va_start(ap, msg);
callbacks->evprintf_filtered (callbacks, msg, ap);
va_end(ap);
- callbacks->error (callbacks, "");
+ /* Printing a space here avoids empty printf compiler warnings. Not ideal,
+ but we want error's side-effect where it halts processing. */
+ callbacks->error (callbacks, " ");
}
void *