public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH/committed] sim: igen: add printf attributes to the prototypes too
@ 2024-01-11  3:31 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2024-01-11  3:31 UTC (permalink / raw)
  To: gdb-patches

While gcc propagates the printf attribute via the typedef, clang
doesn't seem to, so add it to the prototypes themselves too.  We
still keep it on the prototype for cases where it's used as a
variable.
---
 sim/igen/misc.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sim/igen/misc.h b/sim/igen/misc.h
index 04a7f720b41d..5b3a1f03e710 100644
--- a/sim/igen/misc.h
+++ b/sim/igen/misc.h
@@ -50,11 +50,11 @@ struct _line_ref
 
 /* Error appends a new line, warning and notify do not */
 typedef void error_func (const line_ref *line, const char *msg, ...)
-  ATTRIBUTE_PRINTF (2, 3);
+  ATTRIBUTE_PRINTF_2;
 
-extern ATTRIBUTE_NORETURN error_func error;
-extern error_func warning;
-extern error_func notify;
+extern error_func error ATTRIBUTE_PRINTF_2 ATTRIBUTE_NORETURN;
+extern error_func warning ATTRIBUTE_PRINTF_2;
+extern error_func notify ATTRIBUTE_PRINTF_2;
 
 
 #define ERROR(EXPRESSION, args...) \
-- 
2.43.0


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

only message in thread, other threads:[~2024-01-11  3:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-11  3:31 [PATCH/committed] sim: igen: add printf attributes to the prototypes too Mike 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).