sim: mips: add printf attribute to trace func

This helps catch format errors in code, although they're all clean
at this point already.
This commit is contained in:
Mike Frysinger
2021-06-15 01:09:49 -04:00
parent 6828a30253
commit b80d447580
3 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* interp.c (dotrace): Make comment const.
* sim-main.h (dotrace): Likewise. Add ATTRIBUTE_PRINTF.
2021-06-16 Mike Frysinger <vapier@gentoo.org>
* interp.c (sim_monitor): Change ap type to address_word*.

View File

@ -1722,7 +1722,7 @@ dotrace (SIM_DESC sd,
int type,
SIM_ADDR address,
int width,
char *comment,...)
const char *comment, ...)
{
if (STATE & simTRACE) {
va_list ap;

View File

@ -965,7 +965,7 @@ address_word micromips_instruction_decode (SIM_DESC sd, sim_cpu * cpu,
int instruction_size);
#if WITH_TRACE_ANY_P
void dotrace (SIM_DESC sd, sim_cpu *cpu, FILE *tracefh, int type, SIM_ADDR address, int width, char *comment, ...);
void dotrace (SIM_DESC sd, sim_cpu *cpu, FILE *tracefh, int type, SIM_ADDR address, int width, const char *comment, ...) ATTRIBUTE_PRINTF (7, 8);
extern FILE *tracefh;
#else
#define dotrace(sd, cpu, tracefh, type, address, width, comment, ...)