Commit d006f324 authored by Ben Gertzfield's avatar Ben Gertzfield Committed by Jordan DeLong

folly (easy): Disable GCC-specific warning disabling hacks in clang

Summary:
When compiling folly with clang, the compiler warns about our
use of GCC-specific pragmas to silence incorrect compiler warnings:

folly/Optional.h:79:33: warning: unknown warning group '-Wpragmas', ignored [-Wunknown-pragmas]
folly/Optional.h:80:33: warning: unknown warning group '-Wmaybe-uninitialized', ignored [-Wunknown-pragmas]

Thankfully, those incorrect compiler warnings are not emitted by
clang, so we can just disable the pragmas in clang.

Test Plan:
Built folly in gcc and ran it through clang. Warning above
is gone.

Reviewed By: andrei.alexandrescu@fb.com

FB internal diff: D733323
parent 30313905
......@@ -248,8 +248,10 @@ private:
* gcc-4.7 throws what appears to be some false positive uninitialized
* warnings for the members of the MediumLarge struct. So, mute them here.
*/
#if defined(__GNUC__) && !defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wuninitialized"
#endif
/**
* This is the core of the string. The code should work on 32- and
......@@ -834,7 +836,9 @@ private:
}
};
#if defined(__GNUC__) && !defined(__clang__)
# pragma GCC diagnostic pop
#endif
#ifndef _LIBSTDCXX_FBSTRING
/**
......
......@@ -73,7 +73,7 @@ const None none = nullptr;
* gcc-4.7 warns about use of uninitialized memory around the use of storage_
* even though this is explicitly initialized at each point.
*/
#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__clang__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wuninitialized"
# pragma GCC diagnostic ignored "-Wpragmas"
......@@ -245,7 +245,9 @@ class Optional : boost::totally_ordered<Optional<Value>,
bool hasValue_;
};
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
template<class T>
const T* get_pointer(const Optional<T>& opt) {
......
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