Mark the log function as attribute printf
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 6 Jun 2014 05:56:50 +0000 (15:56 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 10 Jun 2014 10:55:10 +0000 (20:55 +1000)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
src/libinput.h

index bc1dc23b3c2bb6c677ab3eb6b50f6dea5af63c2d..4b11563786a56807d345d441c25fbb796391c6f3 100644 (file)
@@ -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
@@ -999,7 +1002,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