From fab0e01146cd82685dd92dda4834a8d970f1b3b8 Mon Sep 17 00:00:00 2001 From: Tudor Bosman Date: Tue, 27 Aug 2013 12:17:48 -0700 Subject: [PATCH] Unbreak build: -Werror=pragmas (srsly) Summary: gcc 4.6 doesn't know of -Wmaybe-uninitialized, so it reports a warning, which we treat as an error. Test Plan: compiled folly/test folly/experimental/test with gcc 4.6.2, 4.7.1, 4.8.1 Reviewed By: philipp@fb.com FB internal diff: D945766 --- folly/experimental/Bits.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/folly/experimental/Bits.h b/folly/experimental/Bits.h index 5983988d..0bf85fcf 100644 --- a/folly/experimental/Bits.h +++ b/folly/experimental/Bits.h @@ -22,6 +22,7 @@ #include #include "folly/Bits.h" +#include "folly/Portability.h" #include "folly/Range.h" namespace folly { @@ -52,7 +53,10 @@ struct BitsTraits, typename std::enable_if< static T loadRMW(const Unaligned& x) { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wuninitialized" +// make sure we compile without warning on gcc 4.6 with -Wpragmas +#if __GNUC_PREREQ(4, 7) #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif return x.value; #pragma GCC diagnostic pop } @@ -68,7 +72,9 @@ struct BitsTraits inline void Bits::set(T* p, size_t bit) { -- 2.34.1