From: Timo Sirainen Date: Thu, 5 Oct 2017 10:26:03 +0000 (+0300) Subject: lib-test: Use i_unreached() for marking unreachable code in test fatal handler X-Git-Tag: 2.3.0.rc1~900 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a2f8919f2dd3fd0a51a1b81a2c67e22552bd381a;p=thirdparty%2Fdovecot%2Fcore.git lib-test: Use i_unreached() for marking unreachable code in test fatal handler This avoids a warning with static analyzer. --- 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)