aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sim/ChangeLog5
-rw-r--r--include/sim/callback.h12
-rw-r--r--sim/common/ChangeLog4
-rw-r--r--sim/common/sim-io.c4
4 files changed, 20 insertions, 5 deletions
diff --git a/include/sim/ChangeLog b/include/sim/ChangeLog
index 0897a52..21a9778 100644
--- a/include/sim/ChangeLog
+++ b/include/sim/ChangeLog
@@ -1,3 +1,8 @@
+2021-06-29 Mike Frysinger <vapier@gentoo.org>
+
+ * sim/callback.h (struct host_callback_struct): Add ATTRIBUTE_PRINTF
+ to printf functions.
+
2021-06-24 Mike Frysinger <vapier@gentoo.org>
* sim/callback.h (struct host_callback_struct): Add arg5, arg6, and
diff --git a/include/sim/callback.h b/include/sim/callback.h
index be72f45..06aa2d4 100644
--- a/include/sim/callback.h
+++ b/include/sim/callback.h
@@ -113,18 +113,22 @@ struct host_callback_struct
int (*init) (host_callback *);
/* depreciated, use vprintf_filtered - Talk to the user on a console. */
- void (*printf_filtered) (host_callback *, const char *, ...);
+ void (*printf_filtered) (host_callback *, const char *, ...)
+ ATTRIBUTE_PRINTF_2;
/* Talk to the user on a console. */
- void (*vprintf_filtered) (host_callback *, const char *, va_list);
+ void (*vprintf_filtered) (host_callback *, const char *, va_list)
+ ATTRIBUTE_PRINTF (2, 0);
/* Same as vprintf_filtered but to stderr. */
- void (*evprintf_filtered) (host_callback *, const char *, va_list);
+ void (*evprintf_filtered) (host_callback *, const char *, va_list)
+ ATTRIBUTE_PRINTF (2, 0);
/* Print an error message and "exit".
In the case of gdb "exiting" means doing a longjmp back to the main
command loop. */
- void (*error) (host_callback *, const char *, ...) ATTRIBUTE_NORETURN;
+ void (*error) (host_callback *, const char *, ...)
+ ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF_2;
int last_errno; /* host format */
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 594994a..291d093 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,9 @@
2021-06-29 Mike Frysinger <vapier@gentoo.org>
+ * sim-io.c (sim_io_error): Change "" to " ".
+
+2021-06-29 Mike Frysinger <vapier@gentoo.org>
+
* callback.c (sim_cb_printf, sim_cb_eprintf): Delete.
(os_poll_quit): Delete __GO32__ support.
* sim-utils.h (sim_cb_printf, sim_cb_eprintf): Delete.
diff --git a/sim/common/sim-io.c b/sim/common/sim-io.c
index e09a4af..d1c2be6 100644
--- a/sim/common/sim-io.c
+++ b/sim/common/sim-io.c
@@ -309,7 +309,9 @@ sim_io_error (SIM_DESC sd,
va_start (ap, fmt);
STATE_CALLBACK (sd)->evprintf_filtered (STATE_CALLBACK (sd), fmt, ap);
va_end (ap);
- STATE_CALLBACK (sd)->error (STATE_CALLBACK (sd), "");
+ /* Printing a space here avoids empty printf compiler warnings. Not ideal,
+ but we want error's side-effect where it halts processing. */
+ STATE_CALLBACK (sd)->error (STATE_CALLBACK (sd), " ");
}
}