public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: ppc: use common ATTRIBUTE_PRINTF macros
@ 2021-06-16  5:14 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2021-06-16  5:14 UTC (permalink / raw)
  To: gdb-patches

Use the common ansidecl.h macros to replace our ad-hoc printf attributes.
---
 sim/ppc/ChangeLog       | 15 +++++++++++++++
 sim/ppc/cpu.h           |  3 ++-
 sim/ppc/device.h        |  2 +-
 sim/ppc/lf.h            |  4 +++-
 sim/ppc/sim_callbacks.h |  2 +-
 sim/ppc/tree.h          |  2 +-
 6 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog
index 6456dde8e1ae..fd3a0c81eca2 100644
--- a/sim/ppc/ChangeLog
+++ b/sim/ppc/ChangeLog
@@ -1,3 +1,18 @@
+2021-06-16  Mike Frysinger  <vapier@gentoo.org>
+
+	* cpu.h: Include ansidecl.h.
+	(cpu_error): Change __attribute__ ((format (printf... to
+	ATTRIBUTE_PRINTF_3.
+	* device.h (device_error): Change __attribute__ ((format (printf...
+	to ATTRIBUTE_PRINTF_2.
+	* lf.h: Include ansidecl.h.
+	(lf_printf): Change __attribute__ ((format (printf... to
+	ATTRIBUTE_PRINTF_2.
+	* sim_callbacks.h (sim_io_printf_filtered): Change __attribute__
+	((format (printf... to ATTRIBUTE_PRINTF_1.
+	* tree.h (tree_parse): Change __attribute__ ((format (printf... to
+	ATTRIBUTE_PRINTF_2.
+
 2021-06-16  Mike Frysinger  <vapier@gentoo.org>
 
 	* double.c: Include ansidecls.h.
diff --git a/sim/ppc/cpu.h b/sim/ppc/cpu.h
index bafb5e1791a1..7dc6074b9c6c 100644
--- a/sim/ppc/cpu.h
+++ b/sim/ppc/cpu.h
@@ -34,6 +34,7 @@
 #include "os_emul.h"
 #include "mon.h"
 #include "model.h"
+#include "ansidecl.h"
 #include "libiberty.h"
 
 #ifndef CONST_ATTRIBUTE
@@ -113,7 +114,7 @@ EXTERN_CPU\
 (cpu *processor,
  unsigned_word cia,
  const char *fmt,
- ...) __attribute__ ((format (printf, 3, 4)));
+ ...) ATTRIBUTE_PRINTF_3;
 
 
 /* The processors local concept of time */
diff --git a/sim/ppc/device.h b/sim/ppc/device.h
index 1bc000876eec..68a2d24dd8df 100644
--- a/sim/ppc/device.h
+++ b/sim/ppc/device.h
@@ -729,7 +729,7 @@ EXTERN_DEVICE\
 (void) device_error
 (device *me,
  const char *fmt,
- ...) __attribute__ ((format (printf, 2, 3)));
+ ...) ATTRIBUTE_PRINTF_2;
 
 INLINE_DEVICE\
 (int) device_trace
diff --git a/sim/ppc/lf.h b/sim/ppc/lf.h
index ce0b8763bba3..fabf8fbc58a8 100644
--- a/sim/ppc/lf.h
+++ b/sim/ppc/lf.h
@@ -20,6 +20,8 @@
 
 /* LF: Line Numbered Output Stream */
 
+#include "ansidecl.h"
+
 typedef struct _lf lf;
 
 typedef enum {
@@ -72,7 +74,7 @@ extern int lf_putbin
 extern int lf_printf
 (lf *file,
  const char *fmt,
- ...) __attribute__((format(printf, 2, 3)));
+ ...) ATTRIBUTE_PRINTF_2;
 
 
 /* Indentation control.
diff --git a/sim/ppc/sim_callbacks.h b/sim/ppc/sim_callbacks.h
index e4d9c70bb016..2b5f2a24c7be 100644
--- a/sim/ppc/sim_callbacks.h
+++ b/sim/ppc/sim_callbacks.h
@@ -29,7 +29,7 @@
 
 #define printf_filtered sim_io_printf_filtered
 void sim_io_printf_filtered
-(const char *msg, ...) __attribute__ ((format (printf, 1, 2)));
+(const char *msg, ...) ATTRIBUTE_PRINTF_1;
 
 void ATTRIBUTE_NORETURN error
 (const char *msg, ...);
diff --git a/sim/ppc/tree.h b/sim/ppc/tree.h
index 165612cb8ec9..6e278d9d1452 100644
--- a/sim/ppc/tree.h
+++ b/sim/ppc/tree.h
@@ -48,7 +48,7 @@ EXTERN_TREE\
 (device *) tree_parse
 (device *root,
  const char *fmt,
- ...) __attribute__ ((format (printf, 2, 3)));
+ ...) ATTRIBUTE_PRINTF_2;
 
 
 INLINE_TREE\
-- 
2.31.1


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

only message in thread, other threads:[~2021-06-16  5:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16  5:14 [PATCH] sim: ppc: use common ATTRIBUTE_PRINTF macros 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).