public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] sim: igen: mark output funcs with printf attribute
@ 2022-11-10 18:41 Michael Frysinger
  0 siblings, 0 replies; only message in thread
From: Michael Frysinger @ 2022-11-10 18:41 UTC (permalink / raw)
  To: gdb-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c0c7e6ce2af0c681ab8ee6f4dc743d95b1d09de4

commit c0c7e6ce2af0c681ab8ee6f4dc743d95b1d09de4
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Thu Nov 10 23:23:34 2022 +0700

    sim: igen: mark output funcs with printf attribute
    
    ... and fix the legitimate bug that it catches.

Diff:
---
 sim/igen/ld-insn.c | 2 +-
 sim/igen/misc.h    | 9 +++------
 2 files changed, 4 insertions(+), 7 deletions(-)

diff --git a/sim/igen/ld-insn.c b/sim/igen/ld-insn.c
index aa9688dda95..a823b3f6cf6 100644
--- a/sim/igen/ld-insn.c
+++ b/sim/igen/ld-insn.c
@@ -448,7 +448,7 @@ parse_insn_words (insn_entry * insn, char *formats)
 				   the same size */
 				if (f->width != refered_field->width)
 				  error (insn->line,
-					 "Conditional `%s' of field `%s' should be of size %s\n",
+					 "Conditional `%s' of field `%s' should be of size %i\n",
 					 cond->string, f->val_string,
 					 refered_field->width);
 			      }
diff --git a/sim/igen/misc.h b/sim/igen/misc.h
index 163ffe498fc..0515c5a5279 100644
--- a/sim/igen/misc.h
+++ b/sim/igen/misc.h
@@ -36,11 +36,7 @@ enum
 #include <stdlib.h>
 #include <string.h>
 
-#if !defined (__attribute__) && (!defined(__GNUC__) || __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7))
-#define __attribute__(arg)
-#endif
-
-
+#include "ansidecl.h"
 
 #include "filter_host.h"
 
@@ -52,7 +48,8 @@ struct _line_ref
 };
 
 /* Error appends a new line, warning and notify do not */
-typedef void error_func (const line_ref *line, const char *msg, ...);
+typedef void error_func (const line_ref *line, const char *msg, ...)
+  ATTRIBUTE_PRINTF (2, 3);
 
 extern error_func error;
 extern error_func warning;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-10 18:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 18:41 [binutils-gdb] sim: igen: mark output funcs with printf attribute Michael Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).