From: Chris Leishman Date: Sat, 26 Aug 2017 05:26:56 +0000 (-0700) Subject: Fix invalid prototype for tcase_name(void) X-Git-Tag: 0.12.0~5^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=178b6d9dcb27648cbc1ad20036fec98afe52028a;p=check Fix invalid prototype for tcase_name(void) The existing prototype in check.h is `const char* tcase_name()`. This causes issues on platforms that use strict prototype checking, e.g. the latest clang compiler with -Wstrict-prototypes ('this function declaration is not a prototype [-Werror,-Wstrict-prototypes]'). --- diff --git a/src/check.c b/src/check.c index 7e4427c..e42636e 100644 --- a/src/check.c +++ b/src/check.c @@ -349,7 +349,7 @@ void tcase_fn_start(const char *fname, const char *file, current_test_name = fname; } -const char* tcase_name() +const char* tcase_name(void) { return current_test_name; } diff --git a/src/check.h.in b/src/check.h.in index 8771146..76f09b0 100644 --- a/src/check.h.in +++ b/src/check.h.in @@ -390,7 +390,7 @@ CK_DLL_EXP void CK_EXPORT tcase_fn_start(const char *fname, const char *file, * * @since 0.11.0 */ -CK_DLL_EXP const char* CK_EXPORT tcase_name(); +CK_DLL_EXP const char* CK_EXPORT tcase_name(void); /** * Start a unit test with START_TEST(unit_name), end with END_TEST.