[PATCH/committed] sim: igen: add printf attributes to the prototypes too

Message ID 20240111033129.25402-1-vapier@gentoo.org
State New
Headers
Series [PATCH/committed] sim: igen: add printf attributes to the prototypes too |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gdb_build--master-arm warning Patch is already merged

Commit Message

Mike Frysinger Jan. 11, 2024, 3:31 a.m. UTC
  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(-)
  

Patch

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...) \