From: Bartosz Golaszewski Date: Sun, 14 May 2017 11:37:51 +0000 (+0200) Subject: tests: put the printf attribute in the header for _test_print_failed() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=c1d8ad3f84ed203e49a0766fee30868d42ab8d17;p=qemu-gpiodev%2Flibgpiod.git 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 --- 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