From: Tudor Bosman Date: Tue, 27 Aug 2013 19:17:48 +0000 (-0700) Subject: Unbreak build: -Werror=pragmas (srsly) X-Git-Tag: v0.22.0~891 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fab0e01146cd82685dd92dda4834a8d970f1b3b8;p=folly.git 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 --- 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) {