From: Mark Santaniello Date: Fri, 13 May 2016 15:41:37 +0000 (-0700) Subject: Suppress new GCC 5 warning -Wbool-compare X-Git-Tag: 2016.07.26~240 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2f1ac6903006adf712cc3ae1641ba527e1b45dee;p=folly.git Suppress new GCC 5 warning -Wbool-compare Summary: This -Wbool-compare is apparently new in GCC 5. We should ignore it, similar to the existing suppression of -Wsign-compare. Reviewed By: pixelb, yfeldblum Differential Revision: D3293675 fbshipit-source-id: 5f90b0dbf049a06c0f6c3df2cdfcc8055358e367 --- diff --git a/folly/Traits.h b/folly/Traits.h index 45f005cb..39136a72 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -337,10 +337,13 @@ struct is_negative_impl { // folly::to integral specializations can end up generating code // inside what are really static ifs (not executed because of the templated -// types) that violate -Wsign-compare so suppress them in order to not prevent -// all calling code from using it. +// types) that violate -Wsign-compare and/or -Wbool-compare so suppress them +// in order to not prevent all calling code from using it. #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wsign-compare" +#if __GNUC_PREREQ(5, 0) +#pragma GCC diagnostic ignored "-Wbool-compare" +#endif template bool less_than_impl(LHS const lhs) { @@ -350,8 +353,6 @@ bool less_than_impl(LHS const lhs) { lhs < rhs; } -#pragma GCC diagnostic pop - template bool greater_than_impl(LHS const lhs) { return @@ -360,6 +361,8 @@ bool greater_than_impl(LHS const lhs) { lhs > rhs; } +#pragma GCC diagnostic pop + } // namespace detail { // same as `x < 0`