From 06fc53d9ab92dcdb14631eb7d9c409800a296cb4 Mon Sep 17 00:00:00 2001 From: Kohei Takahashi Date: Sun, 12 Apr 2015 21:47:22 +0900 Subject: [PATCH] Suppress always false warning with GCC. --- include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp b/include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp index 7e96a3757f..19f2fe8d32 100644 --- a/include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp +++ b/include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp @@ -102,9 +102,17 @@ namespace boost { namespace spirit { namespace qi { namespace detail { if (Radix <= 10) return (ch >= '0' && ch <= static_cast('0' + Radix -1)); +#ifdef BOOST_GCC + // GCC warns the condition, 'always false', if Radix is 10. +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wlogical-op" +#endif return (ch >= '0' && ch <= '9') || (ch >= 'a' && ch <= static_cast('a' + Radix -10 -1)) || (ch >= 'A' && ch <= static_cast('A' + Radix -10 -1)); +#ifdef BOOST_GCC +# pragma GCC diagnostic pop +#endif } template