From ef2f95dfeec663caeb999eb10e1213bc9c518951 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 24 Oct 2016 11:06:23 +1000 Subject: [PATCH] Mark some internal log functions as printf-style function Fixes the respective clang warnings Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Reviewed-by: Eric Engestrom --- src/libinput.c | 1 + test/litest.c | 2 ++ test/misc.c | 1 + tools/event-gui.c | 2 ++ tools/shared.c | 1 + 5 files changed, 7 insertions(+) diff --git a/src/libinput.c b/src/libinput.c index 69580429..6ad497e1 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -159,6 +159,7 @@ struct libinput_event_tablet_pad { } strip; }; +LIBINPUT_ATTRIBUTE_PRINTF(3, 0) static void libinput_default_log_func(struct libinput *libinput, enum libinput_log_priority priority, diff --git a/test/litest.c b/test/litest.c index 4c301b58..fd62d214 100644 --- a/test/litest.c +++ b/test/litest.c @@ -263,6 +263,7 @@ litest_backtrace(void) } #endif +LIBINPUT_ATTRIBUTE_PRINTF(5, 6) void litest_fail_condition(const char *file, int line, @@ -756,6 +757,7 @@ _litest_add_ranged_for_device(const char *name, litest_abort_msg("Invalid test device type"); } +LIBINPUT_ATTRIBUTE_PRINTF(3, 0) static void litest_log_handler(struct libinput *libinput, enum libinput_log_priority pri, diff --git a/test/misc.c b/test/misc.c index 791ebc37..582d4fcf 100644 --- a/test/misc.c +++ b/test/misc.c @@ -847,6 +847,7 @@ const struct libinput_interface leak_interface = { .close_restricted = close_restricted_leak, }; +LIBINPUT_ATTRIBUTE_PRINTF(3, 0) static void simple_log_handler(struct libinput *libinput, enum libinput_log_priority priority, diff --git a/tools/event-gui.c b/tools/event-gui.c index b67ca452..b5dd097c 100644 --- a/tools/event-gui.c +++ b/tools/event-gui.c @@ -108,6 +108,7 @@ struct window { struct libinput_device *devices[50]; }; +LIBINPUT_ATTRIBUTE_PRINTF(1, 2) static int error(const char *fmt, ...) { @@ -121,6 +122,7 @@ error(const char *fmt, ...) return EXIT_FAILURE; } +LIBINPUT_ATTRIBUTE_PRINTF(1, 2) static void msg(const char *fmt, ...) { diff --git a/tools/shared.c b/tools/shared.c index 95655ba7..3ab4b68f 100644 --- a/tools/shared.c +++ b/tools/shared.c @@ -65,6 +65,7 @@ enum options { OPT_PROFILE, }; +LIBINPUT_ATTRIBUTE_PRINTF(3, 0) static void log_handler(struct libinput *li, enum libinput_log_priority priority,