From: Timo Sirainen Date: Fri, 22 Sep 2017 11:10:09 +0000 (+0300) Subject: lib: Define i_unreached() to __builtin_unreachable() with STATIC_CHECKER X-Git-Tag: 2.3.0.rc1~962 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e2e9ea6da9f3db5fd7fe467db79232d20d03832f;p=thirdparty%2Fdovecot%2Fcore.git lib: Define i_unreached() to __builtin_unreachable() with STATIC_CHECKER This helps clang's alpha.deadcode.UnreachableCode checker. --- diff --git a/src/lib/macros.h b/src/lib/macros.h index 2bb96300db..05879079c7 100644 --- a/src/lib/macros.h +++ b/src/lib/macros.h @@ -221,8 +221,12 @@ } \ } 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