]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-test: Use i_unreached() for marking unreachable code in test fatal handler
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 5 Oct 2017 10:26:03 +0000 (13:26 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Thu, 5 Oct 2017 11:31:38 +0000 (14:31 +0300)
This avoids a warning with static analyzer.

src/lib-test/test-common.c

index 9bf14d34afcfc6ee1b5a41c159ff90e3fdacba87..2de90d99d812a0260cf333884f751003226685ef 100644 (file)
@@ -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)