aboutsummaryrefslogtreecommitdiff
path: root/sim/common
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-26 23:02:53 -0400
committerMike Frysinger <vapier@gentoo.org>2021-06-27 10:46:27 -0400
commita7ffa88dc665b09f774c4a8cce1ac31377c96a74 (patch)
treeab8995194730acbd4a359971dee787576e594948 /sim/common
parentded82565c6d432c6dcfc6a867bad479633426a62 (diff)
downloadgdb-a7ffa88dc665b09f774c4a8cce1ac31377c96a74.zip
gdb-a7ffa88dc665b09f774c4a8cce1ac31377c96a74.tar.gz
gdb-a7ffa88dc665b09f774c4a8cce1ac31377c96a74.tar.bz2
sim: cgen: add printf attributes in a few more calls
This helps the compiler process calls to these functions and emit warnings about mismatched format arguments.
Diffstat (limited to 'sim/common')
-rw-r--r--sim/common/ChangeLog5
-rw-r--r--sim/common/cgen-trace.h4
2 files changed, 7 insertions, 2 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index 06f0924..91e254c 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,5 +1,10 @@
2021-06-27 Mike Frysinger <vapier@gentoo.org>
+ * cgen-trace.h (cgen_trace_printf): Add ATTRIBUTE_PRINTF_2.
+ (sim_disasm_sprintf): Likewise.
+
+2021-06-27 Mike Frysinger <vapier@gentoo.org>
+
* cgen-trace.c (cgen_trace_extract): Make name & fmt const.
(cgen_trace_result): Make name const.
(cgen_trace_printf): Make fmt const.
diff --git a/sim/common/cgen-trace.h b/sim/common/cgen-trace.h
index fcf50e9..c617e7e 100644
--- a/sim/common/cgen-trace.h
+++ b/sim/common/cgen-trace.h
@@ -26,7 +26,7 @@ void cgen_trace_insn (SIM_CPU *, const struct cgen_insn *,
const struct argbuf *, IADDR);
void cgen_trace_extract (SIM_CPU *, IADDR, const char *, ...);
void cgen_trace_result (SIM_CPU *, const char *, int, ...);
-void cgen_trace_printf (SIM_CPU *, const char *fmt, ...);
+void cgen_trace_printf (SIM_CPU *, const char *fmt, ...) ATTRIBUTE_PRINTF_2;
/* Trace instruction results. */
#define CGEN_TRACE_RESULT_P(cpu, abuf) \
@@ -75,7 +75,7 @@ typedef struct {
} SFILE;
/* String printer for the disassembler. */
-extern int sim_disasm_sprintf (SFILE *, const char *, ...);
+extern int sim_disasm_sprintf (SFILE *, const char *, ...) ATTRIBUTE_PRINTF_2;
/* For opcodes based disassemblers. */
#ifdef __BFD_H_SEEN__