]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Define i_unreached() to __builtin_unreachable() with STATIC_CHECKER
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 22 Sep 2017 11:10:09 +0000 (14:10 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Fri, 22 Sep 2017 12:47:27 +0000 (15:47 +0300)
This helps clang's alpha.deadcode.UnreachableCode checker.

src/lib/macros.h

index 2bb96300db4e3ecf98d33335320993f9ba0eee92..05879079c7590de38f5df1867b2826ccfd7ca67a 100644 (file)
        } \
        } STMT_END
 
-#define i_unreached() \
+#ifndef STATIC_CHECKER
+#  define i_unreached() \
        i_panic("file %s: line %d: unreached", __FILE__, __LINE__)
+#else
+#  define i_unreached() __builtin_unreachable()
+#endif
 
 /* Convenience macros to test the versions of dovecot. */
 #if defined DOVECOT_VERSION_MAJOR && defined DOVECOT_VERSION_MINOR