Boost C++ Libraries: Ticket #10539: Type error in detail::socket_ops::host_to_network_short https://svn.boost.org/trac10/ticket/10539 <p> Type of <strong>result</strong> local variable should be <strong>u_short_type</strong>. Causes compilation warning C4244 with MSVC ( "possible loss of data" ). </p> <pre class="wiki">u_short_type host_to_network_short(u_short_type value) { #if defined(BOOST_ASIO_WINDOWS_RUNTIME) u_long_type result; unsigned char* result_p = reinterpret_cast&lt;unsigned char*&gt;(&amp;result); result_p[0] = static_cast&lt;unsigned char&gt;((value &gt;&gt; 8) &amp; 0xFF); result_p[1] = static_cast&lt;unsigned char&gt;(value &amp; 0xFF); return result; #else // defined(BOOST_ASIO_WINDOWS_RUNTIME) return htons(value); #endif // defined(BOOST_ASIO_WINDOWS_RUNTIME) } </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10539 Trac 1.4.3