#elif defined(__clang__) || defined(__GNUC__)
# define FOLLY_PUSH_WARNING _Pragma("GCC diagnostic push")
# define FOLLY_POP_WARNING _Pragma("GCC diagnostic pop")
-#define FOLLY_GCC_DISABLE_WARNING_INTERNAL3(warningName) #warningName
-#define FOLLY_GCC_DISABLE_WARNING_INTERNAL2(warningName) \
- FOLLY_GCC_DISABLE_WARNING_INTERNAL3(warningName)
-#define FOLLY_GCC_DISABLE_WARNING(warningName) \
- _Pragma(FOLLY_GCC_DISABLE_WARNING_INTERNAL2(GCC diagnostic ignored \
- FOLLY_GCC_DISABLE_WARNING_INTERNAL3(-W##warningName)))
+# define FOLLY_GCC_DISABLE_WARNING_INTERNAL2(warningName) #warningName
+# define FOLLY_GCC_DISABLE_WARNING(warningName) \
+ _Pragma( \
+ FOLLY_GCC_DISABLE_WARNING_INTERNAL2(GCC diagnostic ignored warningName))
// Disable the MSVC warnings.
# define FOLLY_MSVC_DISABLE_WARNING(warningNumber)
#else
#ifdef HAVE_SHADOW_LOCAL_WARNINGS
#define FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS \
- FOLLY_GCC_DISABLE_WARNING(shadow-compatible-local) \
- FOLLY_GCC_DISABLE_WARNING(shadow-local)
+ FOLLY_GCC_DISABLE_WARNING("-Wshadow-compatible-local") \
+ FOLLY_GCC_DISABLE_WARNING("-Wshadow-local")
#else
#define FOLLY_GCC_DISABLE_NEW_SHADOW_WARNINGS /* empty */
#endif
*/
#define SYNCHRONIZED(...) \
FOLLY_PUSH_WARNING \
- FOLLY_GCC_DISABLE_WARNING(shadow) \
+ FOLLY_GCC_DISABLE_WARNING("-Wshadow") \
FOLLY_MSVC_DISABLE_WARNING(4189) /* initialized but unreferenced */ \
FOLLY_MSVC_DISABLE_WARNING(4456) /* declaration hides local */ \
FOLLY_MSVC_DISABLE_WARNING(4457) /* declaration hides parameter */ \
// types) that violate -Wsign-compare and/or -Wbool-compare so suppress them
// in order to not prevent all calling code from using it.
FOLLY_PUSH_WARNING
-FOLLY_GCC_DISABLE_WARNING(sign-compare)
+FOLLY_GCC_DISABLE_WARNING("-Wsign-compare")
#if __GNUC_PREREQ(5, 0)
-FOLLY_GCC_DISABLE_WARNING(bool-compare)
+FOLLY_GCC_DISABLE_WARNING("-Wbool-compare")
#endif
FOLLY_MSVC_DISABLE_WARNING(4388) // sign-compare
FOLLY_MSVC_DISABLE_WARNING(4804) // bool-compare
size_t count = buf->countChainElements();
if (count <= kSmallSizeMax) {
// suppress "warning: variable length array 'vec' is used [-Wvla]"
- FOLLY_PUSH_WARNING;
- FOLLY_GCC_DISABLE_WARNING(vla);
+ FOLLY_PUSH_WARNING
+ FOLLY_GCC_DISABLE_WARNING("-Wvla")
iovec vec[BOOST_PP_IF(FOLLY_HAVE_VLA, count, kSmallSizeMax)];
- FOLLY_POP_WARNING;
+ FOLLY_POP_WARNING
writeChainImpl(callback, vec, count, std::move(buf), flags);
} else {
#include <folly/Memory.h>
#include <folly/portability/GFlags.h>
-FOLLY_GCC_DISABLE_WARNING(deprecated-declarations)
+FOLLY_GCC_DISABLE_WARNING("-Wdeprecated-declarations")
using namespace folly;
#include <glog/logging.h>
#include <boost/thread/barrier.hpp>
-FOLLY_GCC_DISABLE_WARNING(deprecated-declarations)
+FOLLY_GCC_DISABLE_WARNING("-Wdeprecated-declarations")
using namespace folly;
#include <folly/portability/GTest.h>
#include <folly/portability/Unistd.h>
-FOLLY_GCC_DISABLE_WARNING(deprecated-declarations)
+FOLLY_GCC_DISABLE_WARNING("-Wdeprecated-declarations")
using namespace folly;