From: Victor Gao Date: Wed, 19 Jul 2017 23:24:54 +0000 (-0700) Subject: change the definition of FOLLY_MAYBE_UNUSED X-Git-Tag: v2017.07.24.00~19 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4b807f9ef3410b33923c6575cc57a667eeb53a76;p=folly.git change the definition of FOLLY_MAYBE_UNUSED Summary: Currently gcc does not support attributes declared using square brackets well and some builds might break because of this. Since `__attribute__((...))` works for both clang and gcc, we should switch to it for now. Reviewed By: yfeldblum Differential Revision: D5456734 fbshipit-source-id: d7a8bf1389afc5d60604f22d37c93611dc46259c --- diff --git a/folly/CppAttributes.h b/folly/CppAttributes.h index 542e2718..f1ed1c23 100644 --- a/folly/CppAttributes.h +++ b/folly/CppAttributes.h @@ -65,10 +65,8 @@ * #endif * } */ -#if FOLLY_HAS_CPP_ATTRIBUTE(maybe_unused) -#define FOLLY_MAYBE_UNUSED [[maybe_unused]] -#elif FOLLY_HAS_CPP_ATTRIBUTE(gnu::unused) -#define FOLLY_MAYBE_UNUSED [[gnu::unused]] +#if FOLLY_HAS_CPP_ATTRIBUTE(__unused__) +#define FOLLY_MAYBE_UNUSED __attribute__((__unused__)) #else #define FOLLY_MAYBE_UNUSED #endif