From c1d8ad3f84ed203e49a0766fee30868d42ab8d17 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Sun, 14 May 2017 13:37:51 +0200 Subject: [PATCH] tests: put the printf attribute in the header for _test_print_failed() If the printf attribute is only present next to the function's definition, the compiler only checks the calls in the same compilation unit. In order to verify all the calls, annotate the declaration of _test_print_failed() in gpiod-test.h. Signed-off-by: Bartosz Golaszewski --- tests/gpiod-test.c | 2 +- tests/gpiod-test.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/gpiod-test.c b/tests/gpiod-test.c index 9f84fbd..8dfa913 100644 --- a/tests/gpiod-test.c +++ b/tests/gpiod-test.c @@ -653,7 +653,7 @@ void _test_register(struct _test_case *test) globals.num_tests++; } -TEST_PRINTF(1, 2) void _test_print_failed(const char *fmt, ...) +void _test_print_failed(const char *fmt, ...) { int status; va_list va; diff --git a/tests/gpiod-test.h b/tests/gpiod-test.h index 26f8945..d4404b8 100644 --- a/tests/gpiod-test.h +++ b/tests/gpiod-test.h @@ -41,7 +41,7 @@ struct _test_case { }; void _test_register(struct _test_case *test); -void _test_print_failed(const char *fmt, ...); +void _test_print_failed(const char *fmt, ...) TEST_PRINTF(1, 2); /* * This macro should be used for code brevity instead of manually declaring -- 2.30.2