Boost C++ Libraries: Ticket #9991: WConversion issue in json_parser_write.hpp https://svn.boost.org/trac10/ticket/9991 <p> File Name: 1_54_0/boost/property_tree/detail/json_parser_write.hpp </p> <p> There is a severe problem with the -Wconversion issue in the json_parser_write.hpp </p> <p> Problematic code: </p> <blockquote> <p> else </p> <blockquote> <p> { </p> <blockquote> <p> const char *hexdigits = "0123456789ABCDEF"; typedef typename make_unsigned&lt;Ch&gt;::type UCh; unsigned long u = (std::min)(static_cast&lt;unsigned long&gt;( </p> <blockquote> <p> static_cast&lt;UCh&gt;(*b)), </p> </blockquote> <p> 0xFFFFul); </p> </blockquote> </blockquote> </blockquote> <blockquote> <blockquote> <blockquote> <p> <strong> int d1 = u / 4096; u -= d1 * 4096; </strong></p> <blockquote> <p> int d2 = u / 256; u -= d2 * 256; int d3 = u / 16; u -= d3 * 16; int d4 = u;<strong> </strong></p> </blockquote> </blockquote> </blockquote> </blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <p> result += Ch('<br />'); result += Ch('u'); result += Ch(hexdigits[d1]); result += Ch(hexdigits[d2]); result += Ch(hexdigits[d3]); result += Ch(hexdigits[d4]); </p> </blockquote> </blockquote> <p> } </p> </blockquote> </blockquote> <p> 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. </p> <p> the above need to be fixed. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9991 Trac 1.4.3 anonymous Fri, 02 May 2014 06:23:51 GMT component changed; owner set https://svn.boost.org/trac10/ticket/9991#comment:1 https://svn.boost.org/trac10/ticket/9991#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Sebastian Redl</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">property_tree</span> </li> </ul> Ticket anonymous Fri, 02 May 2014 06:24:18 GMT keywords changed https://svn.boost.org/trac10/ticket/9991#comment:2 https://svn.boost.org/trac10/ticket/9991#comment:2 <ul> <li><strong>keywords</strong> property tree added </li> </ul> Ticket Sebastian Redl Wed, 10 Feb 2016 13:04:37 GMT status changed https://svn.boost.org/trac10/ticket/9991#comment:3 https://svn.boost.org/trac10/ticket/9991#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> <p> Fixed by commit <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/6" title="#6: Bugs: tie in utility.hpp and tuple.hpp clash. (closed: Duplicate)">#6</a>a033ffca2b8219bb581c013c3bbd6c31f8151ff </p> Ticket