The cgen trace macros are a bit ugly in that they specify a series of
format strings & arguments in a single call. This means we pass a
non-literal string to printf and the compiler warns about it. Use
the diagnostic macros to suppress that in this one place.
+2021-06-27 Mike Frysinger <vapier@gentoo.org>
+
+ * cgen-trace.c: Include diagnostics.h.
+ (cgen_trace_extract): Call DIAGNOSTIC_PUSH,
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL, and DIAGNOSTIC_POP.
+
2021-06-27 Mike Frysinger <vapier@gentoo.org>
* cgen-run.c (engine_run_n): Assert cpu arguments are valid.
#include <errno.h>
#include <stdlib.h>
+#include "diagnostics.h"
#include "dis-asm.h"
#include "bfd.h"
#include "sim-main.h"
{
case 'x' :
ival = va_arg (args, int);
+ DIAGNOSTIC_PUSH
+ DIAGNOSTIC_IGNORE_FORMAT_NONLITERAL
trace_printf (CPU_STATE (cpu), cpu, fmt, ival);
+ DIAGNOSTIC_POP
break;
default :
abort ();