From 2f3ce76e9672ef7c21d6abe0baec18c626af539f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Jul 2020 20:08:41 +0200 Subject: Add printf format function annotation --- tests/sratom_test.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests') diff --git a/tests/sratom_test.c b/tests/sratom_test.c index 1449774..4af757d 100644 --- a/tests/sratom_test.c +++ b/tests/sratom_test.c @@ -28,6 +28,12 @@ #define USTR(s) ((const uint8_t*)(s)) +#if defined(__GNUC__) +# define SRATOM_LOG_FUNC(fmt, arg1) __attribute__((format(printf, fmt, arg1))) +#else +# define SRATOM_LOG_FUNC(fmt, arg1) +#endif + /// Simple O(n) URI map typedef struct { char** uris; @@ -71,6 +77,7 @@ urid_unmap(LV2_URID_Unmap_Handle handle, return NULL; } +SRATOM_LOG_FUNC(1, 2) static int test_fail(const char* fmt, ...) { -- cgit v1.2.1