mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-27 01:28:46 +00:00
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.
This commit is contained in:
@@ -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), " ");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user