From b61bf569407e0fac80ae81df65b5a545461b4d21 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Tue, 14 Jul 2015 10:45:36 +0300 Subject: [PATCH 1/2] Fix signed/unsigned mismatch warning on gcc. --- include/boost/spirit/home/qi/numeric/detail/real_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp b/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp index 424d933a64..ce0a8b3026 100644 --- a/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp +++ b/include/boost/spirit/home/qi/numeric/detail/real_impl.hpp @@ -65,7 +65,7 @@ namespace boost { namespace spirit { namespace traits { if (exp >= 0) { - std::size_t max_exp = std::numeric_limits::max_exponent10; + int max_exp = std::numeric_limits::max_exponent10; // return false if exp exceeds the max_exp // do this check only for primitive types! From eb1a197673867d6491a230e36933aa02955082b4 Mon Sep 17 00:00:00 2001 From: Andrey Semashev Date: Tue, 14 Jul 2015 10:56:18 +0300 Subject: [PATCH 2/2] Fix signed/unsigned mismatch warning on gcc. --- include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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..d50bde8ff3 100644 --- a/include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp +++ b/include/boost/spirit/home/qi/numeric/detail/numeric_utils.hpp @@ -316,7 +316,7 @@ namespace boost { namespace spirit { namespace qi { namespace detail if (!Accumulate) { // skip leading zeros - while (it != last && *it == '0' && leading_zeros < MaxDigits) + while (it != last && *it == '0' && (MaxDigits < 0 || leading_zeros < static_cast< std::size_t >(MaxDigits))) { ++it; ++leading_zeros;