diff --git a/tests/t0020-dirent.c b/tests/t0020-dirent.c index e8abd2f25..966f3c578 100644 --- a/tests/t0020-dirent.c +++ b/tests/t0020-dirent.c @@ -105,7 +105,6 @@ static int one_entry(void *state, char *path) } } test_die("unexpected path \"%s\"", path); - return -1; } @@ -189,7 +188,6 @@ static walk_data empty = { static int dont_call_me(void *state, char *path) { test_die("dont_call_me: unexpected callback!"); - return -1; } BEGIN_TEST(empty) diff --git a/tests/test_lib.h b/tests/test_lib.h index 52121c9b1..8e9d2f904 100644 --- a/tests/test_lib.h +++ b/tests/test_lib.h @@ -29,6 +29,8 @@ /** Declare a function never returns to the caller. */ #ifdef __GNUC__ # define NORETURN __attribute__((__noreturn__)) +#elif defined(_MSC_VER) +# define NORETURN __declspec(noreturn) #else # define NORETURN /* noreturn */ #endif @@ -61,8 +63,7 @@ extern void test_end(void); * * @param fmt printf style format string. */ -extern void test_die(const char *fmt, ...) - NORETURN +extern void NORETURN test_die(const char *fmt, ...) GIT_FORMAT_PRINTF(1, 2); /**