sim: ppc: fix printf warnings

This code hits some format-zero-length warnings, so hack the code
like we did in the common layers.
This commit is contained in:
Mike Frysinger
2021-06-29 21:45:13 -04:00
parent 7f6fa74374
commit f8261de1b2
3 changed files with 16 additions and 2 deletions

View File

@ -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).

View File

@ -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, ...)
{

View File

@ -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 *