[PATCH libinput 8/8] Mark the log function as attribute printf

Peter Hutterer peter.hutterer at who-t.net
Thu Jun 5 23:19:06 PDT 2014


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/libinput.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/libinput.h b/src/libinput.h
index d771e21..b4cb5e5 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -31,6 +31,9 @@ extern "C" {
 #include <stdint.h>
 #include <libudev.h>
 
+#define LIBINPUT_ATTRIBUTE_PRINTF(_format, _args) \
+	__attribute__ ((format (printf, _format, _args)))
+
 /**
  * @mainpage
  * libinput is a generic input device handling library. It abstracts
@@ -1045,7 +1048,8 @@ libinput_log_get_priority(void);
  */
 typedef void (*libinput_log_handler)(enum libinput_log_priority priority,
 				     void *user_data,
-				     const char *format, va_list args);
+				     const char *format, va_list args)
+	   LIBINPUT_ATTRIBUTE_PRINTF(3, 0);
 
 /**
  * @ingroup base
-- 
1.9.3



More information about the wayland-devel mailing list