From a2f8919f2dd3fd0a51a1b81a2c67e22552bd381a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 5 Oct 2017 13:26:03 +0300 Subject: [PATCH] lib-test: Use i_unreached() for marking unreachable code in test fatal handler This avoids a warning with static analyzer. --- src/lib-test/test-common.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/lib-test/test-common.c b/src/lib-test/test-common.c index 9bf14d34af..2de90d99d8 100644 --- a/src/lib-test/test-common.c +++ b/src/lib-test/test-common.c @@ -174,16 +174,15 @@ test_error_handler(const struct failure_context *ctx, } static void ATTR_FORMAT(2, 0) ATTR_NORETURN -test_fatal_handler(const struct failure_context *ctx, - const char *format, va_list args) +test_fatal_handler(const struct failure_context *ctx ATTR_UNUSED, + const char *format ATTR_UNUSED, va_list args ATTR_UNUSED) { /* Prevent recursion, we can't handle our own errors */ i_set_fatal_handler(default_fatal_handler); i_assert(expecting_fatal); /* if not at the right time, bail */ i_set_fatal_handler(test_fatal_handler); longjmp(fatal_jmpbuf, 1); - /* we simply can't get here - will the compiler complain? */ - default_fatal_handler(ctx, format, args); + i_unreached(); /* we simply can't get here */ } static void test_init(void) -- 2.47.3