aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-27 23:21:26 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-29 02:14:58 -0400
commita1d9117f94cd835b266c6ec17b4cdcf4ce31b9ee (patch)
treea2a63af1428c51402143b8ba2b9458e1a7bb54ee /sim/common
parent54e66d16e880f84a56caf1fd4ac9a5ffc3568bc3 (diff)
downloadgdb-a1d9117f94cd835b266c6ec17b4cdcf4ce31b9ee.zip
gdb-a1d9117f94cd835b266c6ec17b4cdcf4ce31b9ee.tar.gz
gdb-a1d9117f94cd835b266c6ec17b4cdcf4ce31b9ee.tar.bz2
sim: callback: add printf attributes
This helps these funcs get printf format checking coverage. The sim-io.c hack as a result is a bit unfortunate, but the compiler throws warnings when printing with empty strings. In this one case, we actually want that due to the side-effect of the callback halting execution for us.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog4
-rw-r--r--sim/common/sim-io.c4
2 files changed, 7 insertions, 1 deletions
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), " ");
}
}