From: Pádraig Brady Date: Sat, 18 Nov 2017 22:25:54 +0000 (-0800) Subject: folly: support FOLLY_FALLTHROUGH on GCC X-Git-Tag: v2017.11.20.00~3 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=13cc05eaec5c19feaedc0b7fec17a6272f4b3f83;p=folly.git folly: support FOLLY_FALLTHROUGH on GCC Summary: This is required to avoid new GCC 7 -Wimplict-fallthrough warnings. We also update to use the C++17 [[fallthrough]] attribute if supported. Reviewed By: yfeldblum Differential Revision: D6367140 fbshipit-source-id: d5380983cb300f944df9c2885d0faa0155994be7 --- diff --git a/folly/CppAttributes.h b/folly/CppAttributes.h index 466aab91..2ebbae8c 100644 --- a/folly/CppAttributes.h +++ b/folly/CppAttributes.h @@ -53,8 +53,12 @@ * FOLLY_FALLTHROUGH; // no warning: annotated fall-through * } */ -#if FOLLY_HAS_CPP_ATTRIBUTE(clang::fallthrough) +#if FOLLY_HAS_CPP_ATTRIBUTE(fallthrough) +#define FOLLY_FALLTHROUGH [[fallthrough]] +#elif FOLLY_HAS_CPP_ATTRIBUTE(clang::fallthrough) #define FOLLY_FALLTHROUGH [[clang::fallthrough]] +#elif FOLLY_HAS_CPP_ATTRIBUTE(gnu::fallthrough) +#define FOLLY_FALLTHROUGH [[gnu::fallthrough]] #else #define FOLLY_FALLTHROUGH #endif