id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 5658,how to get rid of nasty compiler warning in boost/property_tree/detail/rapidxml.hpp,Dieter Stach ,Sebastian Redl,"compiling e.g libs/graph/src/graphml.cpp warns ... {{{ /boost/property_tree/detail/rapidxml.hpp: In function `size_t boost::property_t ree::detail::rapidxml::internal::get_index(Ch) [with Ch = char]': ./boost/property_tree/detail/rapidxml.hpp:1413: instantiated from `static unsi gned char boost::property_tree::detail::rapidxml::xml_document::whitespace_p red::test(Ch) [with Ch = char]' ./boost/property_tree/detail/rapidxml.hpp:1542: instantiated from `static void boost::property_tree::detail::rapidxml::xml_document::skip(Ch*&) [with Stop Pred = boost::property_tree::detail::rapidxml::xml_document::whitespace_pr ed, int Flags = 3072, Ch = char]' ./boost/property_tree/detail/rapidxml.hpp:1377: instantiated from `void boost: :property_tree::detail::rapidxml::xml_document::parse(Ch*) [with int Flags = 3072, Ch = char]' ./boost/property_tree/detail/xml_parser_read_rapidxml.hpp:116: instantiated fr om `void boost::property_tree::xml_parser::read_xml_internal(std::basic_istream< typename Ptree::key_type::value_type, std::char_traits >&, Ptree&, int, const std::string&) [with Ptree = boost::property_ tree::basic_ptree >]' ./boost/property_tree/xml_parser.hpp:52: instantiated from `void boost::proper ty_tree::xml_parser::read_xml(std::basic_istream >&, Ptree&, int) [ with Ptree = boost::property_tree::ptree]' libs/graph/src/graphml.cpp:49: instantiated from here ./boost/property_tree/detail/rapidxml.hpp:317: warning: comparison is always fal se due to limited range of data type }}} Caused by the template: {{{ template inline size_t get_index(const Ch c) { // If not ASCII char, its sematic is same as plain 'z' if (c > 255) { return 'z'; } return c; } }}} How to avoid ? Just specify additionally a user defined implementation of get_index for the ""char"" type : {{{ inline size_t get_index(const char c) { return c; } template inline size_t get_index(const Ch c) { // If not ASCII char, its sematic is same as plain 'z' if (c > 255) { return 'z'; } return c; } }}} I checked the code size (using gcc4.0) : same and the difference of the ASM code: ""same"" {{{ 14972c14972 < cmpq (%r15), %rdi --- > cmpq %rdi, (%r15) 14974c14974 < jae .L3637 --- > jbe .L3637 15002c15002 < cmpq -16(%rsi), %rdi --- > cmpq %rdi, -16(%rsi) 15004c15004 < jae .L3643 --- > jbe .L3643 15017c15017 < cmpq -16(%rdx), %rdi --- > cmpq %rdi, -16(%rdx) 15019c15019 < jb .L3796 --- > ja .L3796 15487c15487 --- }}}",Tasks,assigned,To Be Determined,property_tree,Boost 1.46.1,Optimization,,,gcc 4.0 mateusz@…