From 13cc05eaec5c19feaedc0b7fec17a6272f4b3f83 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sat, 18 Nov 2017 14:25:54 -0800 Subject: [PATCH] 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 --- folly/CppAttributes.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.34.1