id summary reporter owner description type status milestone component version severity resolution keywords cc
9991 WConversion issue in json_parser_write.hpp abhi.california@… Sebastian Redl "File Name:
1_54_0/boost/property_tree/detail/json_parser_write.hpp
There is a severe problem with the -Wconversion issue in the json_parser_write.hpp
Problematic code:
else
{
const char *hexdigits = ""0123456789ABCDEF"";
typedef typename make_unsigned::type UCh;
unsigned long u = (std::min)(static_cast(
static_cast(*b)),
0xFFFFul);
''' int d1 = u / 4096; u -= d1 * 4096;
int d2 = u / 256; u -= d2 * 256;
int d3 = u / 16; u -= d3 * 16;
int d4 = u;'''
result += Ch('\\'); result += Ch('u');
result += Ch(hexdigits[d1]); result += Ch(hexdigits[d2]);
result += Ch(hexdigits[d3]); result += Ch(hexdigits[d4]);
}
Either we need to do explicit static cast to suppress the Conversion Warning.
When we turn on the -Wconversion as well as -Werror both together, which is good practice for production ready code. compiler Just dont allow this to compile.
the above need to be fixed." Bugs assigned To Be Determined property_tree Boost 1.54.0 Problem JSON property tree