From 30f5fbd4caf6332d469c3cc77e7bfaafa4748fbf Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 8 Feb 2015 13:42:04 +0100 Subject: [PATCH] work around gcc being nervous when static functions are unused. --- src/tests.c | 3 ++- src/tests.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tests.c b/src/tests.c index f560dc59a..b1dbc876b 100644 --- a/src/tests.c +++ b/src/tests.c @@ -273,6 +273,7 @@ void assert_messages(struct CuTest * tc, struct mlist *msglist, const message_ty va_end(args); } -void disabled_test(void *suite, const char *name) { +void disabled_test(void *suite, void (*test)(CuTest *), const char *name) { + (void)test; fprintf(stderr, "%s: SKIP\n", name); } diff --git a/src/tests.h b/src/tests.h index 15c27f315..3da238fdc 100644 --- a/src/tests.h +++ b/src/tests.h @@ -47,9 +47,9 @@ extern "C" { void assert_messages(struct CuTest * tc, struct mlist *msglist, const struct message_type **types, int num_msgs, bool exact_match, ...); - void disabled_test(void *suite, const char *name); + void disabled_test(void *suite, void (*)(struct CuTest *), const char *name); -#define DISABLE_TEST(SUITE, TEST) disabled_test(SUITE, #TEST) +#define DISABLE_TEST(SUITE, TEST) disabled_test(SUITE, TEST, #TEST) #ifdef __cplusplus }