[Boost-bugs] [Boost C++ Libraries] #5598: boost/property_tree/detail/json_parser_write.hpp:35: warning: comparison is always true due to limited range of data type

Subject: [Boost-bugs] [Boost C++ Libraries] #5598: boost/property_tree/detail/json_parser_write.hpp:35: warning: comparison is always true due to limited range of data type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-06-07 17:11:38


#5598: boost/property_tree/detail/json_parser_write.hpp:35: warning: comparison is
always true due to limited range of data type
-------------------------------+--------------------------------------------
 Reporter: benoit@… | Owner: cornedbee
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: property_tree
  Version: Boost 1.46.1 | Severity: Problem
 Keywords: |
-------------------------------+--------------------------------------------
 Here is the relevant output:
 {{{
 cc1plus: warnings being treated as errors
 gcc41_64/include/boost/property_tree/detail/json_parser_write.hpp: In
 function 'std::basic_string<_CharT, std::char_traits<_CharT>,
 std::allocator<_CharT> >
 boost::property_tree::json_parser::create_escapes(const
 std::basic_string<_CharT, std::char_traits<_CharT>, std::allocator<_CharT>
>&) [with Ch = char]':
 gcc41_64/include/boost/property_tree/detail/json_parser_write.hpp:78:
 instantiated from 'void
 boost::property_tree::json_parser::write_json_helper(std::basic_ostream<typename
 Ptree::key_type::value_type, std::char_traits<typename
 Ptree::key_type::value_type> >&, const Ptree&, int, bool) [with Ptree =
 boost::property_tree::basic_ptree<std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >,
 std::less<std::basic_string<char, std::char_traits<char>,
 std::allocator<char> > > >]'
 gcc41_64/include/boost/property_tree/detail/json_parser_write.hpp:162:
 instantiated from 'void
 boost::property_tree::json_parser::write_json_internal(std::basic_ostream<typename
 Ptree::key_type::value_type, std::char_traits<typename
 Ptree::key_type::value_type> >&, const Ptree&, const std::string&, bool)
 [with Ptree = boost::property_tree::basic_ptree<std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >,
 std::less<std::basic_string<char, std::char_traits<char>,
 std::allocator<char> > > >]'
 gcc41_64/include/boost/property_tree/json_parser.hpp:98: instantiated
 from 'void
 boost::property_tree::json_parser::write_json(std::basic_ostream<typename
 Ptree::key_type::value_type, std::char_traits<typename
 Ptree::key_type::value_type> >&, const Ptree&, bool) [with Ptree =
 boost::property_tree::basic_ptree<std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >, std::basic_string<char,
 std::char_traits<char>, std::allocator<char> >,
 std::less<std::basic_string<char, std::char_traits<char>,
 std::allocator<char> > > >]'
 json.cc:36: instantiated from here
 gcc41_64/include/boost/property_tree/detail/json_parser_write.hpp:35:
 warning: comparison is always true due to limited range of data type
 make: *** [json.o] Error 1
 }}}

 In the big if() statement, *b (of type Ch, which is char) is being
 compared with 0xFF.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/5598>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:06 UTC