sim: mips: add printf attribute to trace func
authorMike Frysinger <vapier@gentoo.org>
Tue, 15 Jun 2021 05:09:49 +0000 (01:09 -0400)
committerMike Frysinger <vapier@gentoo.org>
Wed, 16 Jun 2021 05:56:22 +0000 (01:56 -0400)
This helps catch format errors in code, although they're all clean
at this point already.

sim/mips/ChangeLog
sim/mips/interp.c
sim/mips/sim-main.h

index c36e01fa19eb47286dad2ecea3ffea4977030f62..c582abc074479758a585c9fc1f75fba41f5234ae 100644 (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*.
index 5645f01ed2251c54e8dee4bc56ff1841f5448d10..a6f504acc764f4ea1004f74e76ea4f1de351b071 100644 (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;
index 8c9abfa0b0b32cce691c08510edc5379104c5330..990573996bb96ffa4ce6a84d7140bc0fc224e00f 100644 (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, ...)
This page took 0.028389 seconds and 4 git commands to generate.