From f41b92134a276716b7e2d7ef54996b30f36a10a9 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 5 Feb 2018 19:51:09 -0500 Subject: [PATCH] Fix fallthrough compiler warning with gcc >= 7 Fixes https://github.com/harfbuzz/harfbuzz/issues/755 --- src/hb-private.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hb-private.hh b/src/hb-private.hh index eba797cfc..53ed11c81 100644 --- a/src/hb-private.hh +++ b/src/hb-private.hh @@ -154,6 +154,9 @@ extern "C" void hb_free_impl(void *ptr); #if defined(__clang__) && __cplusplus >= 201103L /* clang's fallthrough annotations are only available starting in C++11. */ # define HB_FALLTHROUGH [[clang::fallthrough]] +#elif __GNUC__ >= 7 + /* GNU fallthrough attribute is available from GCC7 */ +# define HB_FALLTHROUGH __attribute__((fallthrough)) #elif defined(_MSC_VER) /* * MSVC's __fallthrough annotations are checked by /analyze (Code Analysis):