Commit fab0e011 authored by Tudor Bosman's avatar Tudor Bosman Committed by Sara Golemon

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
parent 2b356118
......@@ -22,6 +22,7 @@
#include <limits>
#include "folly/Bits.h"
#include "folly/Portability.h"
#include "folly/Range.h"
namespace folly {
......@@ -52,7 +53,10 @@ struct BitsTraits<Unaligned<T>, typename std::enable_if<
static T loadRMW(const Unaligned<T>& 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<T, typename std::enable_if<
static T loadRMW(const T& x) {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#if __GNUC_PREREQ(4, 7)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
return x;
#pragma GCC diagnostic pop
}
......@@ -171,7 +177,9 @@ struct Bits {
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wuninitialized"
#if __GNUC_PREREQ(4, 7)
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
template <class T, class Traits>
inline void Bits<T, Traits>::set(T* p, size_t bit) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment