Boost C++ Libraries: Ticket #8963: Warnings from binary archives https://svn.boost.org/trac10/ticket/8963 <p> Simply #including: </p> <p> #include &lt;boost/archive/binary_iarchive.hpp&gt; #include &lt;boost/archive/binary_oarchive.hpp&gt; </p> <p> Is sufficient to generate several pages of msvc warnings: </p> <pre class="wiki">1&gt;d:\data\boost\trunk\boost\archive\basic_binary_iprimitive.hpp(181): warning C4244: 'argument' : conversion from 'std::streamsize' to 'size_t', possible loss of data 1&gt; d:\data\boost\trunk\boost\archive\basic_binary_iprimitive.hpp(152) : while compiling class template member function 'void boost::archive::basic_binary_iprimitive&lt;Archive,Elem,Tr&gt;::load_binary(void *,size_t)' 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; Elem=char, 1&gt; Tr=std::char_traits&lt;char&gt; 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(362) : see reference to function template instantiation 'void boost::archive::load_access::load_primitive&lt;Archive,T&gt;(Archive &amp;,T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(439) : see reference to function template instantiation 'void boost::archive::detail::load_non_pointer_type&lt;Archive&gt;::load_primitive::invoke&lt;T&gt;(Archive &amp;,T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(592) : see reference to function template instantiation 'void boost::archive::detail::load_non_pointer_type&lt;Archive&gt;::invoke&lt;T&gt;(Archive &amp;,T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(66) : see reference to function template instantiation 'void boost::archive::load&lt;Archive,T&gt;(Archive &amp;,T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\basic_binary_iarchive.hpp(70) : see reference to function template instantiation 'void boost::archive::detail::common_iarchive&lt;Archive&gt;::load_override&lt;T&gt;(T &amp;,int)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\binary_iarchive_impl.hpp(50) : see reference to function template instantiation 'void boost::archive::basic_binary_iarchive&lt;Archive&gt;::load_override&lt;T&gt;(T &amp;,int)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\interface_iarchive.hpp(60) : see reference to function template instantiation 'void boost::archive::binary_iarchive_impl&lt;Archive,Elem,Tr&gt;::load_override&lt;T&gt;(T &amp;,int)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; Elem=char, 1&gt; Tr=std::char_traits&lt;char&gt;, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(48) : see reference to function template instantiation 'Archive &amp;boost::archive::detail::interface_iarchive&lt;Archive&gt;::operator &gt;&gt;&lt;boost::archive::object_id_type&gt;(T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(47) : while compiling class template member function 'void boost::archive::detail::common_iarchive&lt;Archive&gt;::vload(boost::archive::object_id_type &amp;)' 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\basic_binary_iarchive.hpp(52) : see reference to class template instantiation 'boost::archive::detail::common_iarchive&lt;Archive&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\binary_iarchive_impl.hpp(36) : see reference to class template instantiation 'boost::archive::basic_binary_iarchive&lt;Archive&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\binary_iarchive.hpp(42) : see reference to class template instantiation 'boost::archive::binary_iarchive_impl&lt;Archive,Elem,Tr&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::naked_binary_iarchive, 1&gt; Elem=char, 1&gt; Tr=std::char_traits&lt;char&gt; 1&gt; ] 1&gt;d:\data\boost\trunk\boost\archive\basic_binary_iprimitive.hpp(181): warning C4244: 'argument' : conversion from 'std::streamsize' to 'size_t', possible loss of data 1&gt; d:\data\boost\trunk\boost\archive\basic_binary_iprimitive.hpp(152) : while compiling class template member function 'void boost::archive::basic_binary_iprimitive&lt;Archive,Elem,Tr&gt;::load_binary(void *,size_t)' 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; Elem=char, 1&gt; Tr=std::char_traits&lt;char&gt; 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(362) : see reference to function template instantiation 'void boost::archive::load_access::load_primitive&lt;Archive,T&gt;(Archive &amp;,T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(439) : see reference to function template instantiation 'void boost::archive::detail::load_non_pointer_type&lt;Archive&gt;::load_primitive::invoke&lt;T&gt;(Archive &amp;,T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(592) : see reference to function template instantiation 'void boost::archive::detail::load_non_pointer_type&lt;Archive&gt;::invoke&lt;T&gt;(Archive &amp;,T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(66) : see reference to function template instantiation 'void boost::archive::load&lt;Archive,T&gt;(Archive &amp;,T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\basic_binary_iarchive.hpp(70) : see reference to function template instantiation 'void boost::archive::detail::common_iarchive&lt;Archive&gt;::load_override&lt;T&gt;(T &amp;,int)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\binary_iarchive_impl.hpp(50) : see reference to function template instantiation 'void boost::archive::basic_binary_iarchive&lt;Archive&gt;::load_override&lt;T&gt;(T &amp;,int)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\interface_iarchive.hpp(60) : see reference to function template instantiation 'void boost::archive::binary_iarchive_impl&lt;Archive,Elem,Tr&gt;::load_override&lt;T&gt;(T &amp;,int)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; Elem=char, 1&gt; Tr=std::char_traits&lt;char&gt;, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(48) : see reference to function template instantiation 'Archive &amp;boost::archive::detail::interface_iarchive&lt;Archive&gt;::operator &gt;&gt;&lt;boost::archive::object_id_type&gt;(T &amp;)' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; T=boost::archive::object_id_type 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(47) : while compiling class template member function 'void boost::archive::detail::common_iarchive&lt;Archive&gt;::vload(boost::archive::object_id_type &amp;)' 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\basic_binary_iarchive.hpp(52) : see reference to class template instantiation 'boost::archive::detail::common_iarchive&lt;Archive&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\binary_iarchive_impl.hpp(36) : see reference to class template instantiation 'boost::archive::basic_binary_iarchive&lt;Archive&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive 1&gt; ] 1&gt; d:\data\boost\trunk\boost\archive\binary_iarchive.hpp(76) : see reference to class template instantiation 'boost::archive::binary_iarchive_impl&lt;Archive,Elem,Tr&gt;' being compiled 1&gt; with 1&gt; [ 1&gt; Archive=boost::archive::binary_iarchive, 1&gt; Elem=char, 1&gt; Tr=std::char_traits&lt;char&gt; 1&gt; ] </pre><p> The attached patch fixes the warning. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8963 Trac 1.4.3 John Maddock Sun, 04 Aug 2013 17:47:44 GMT attachment set https://svn.boost.org/trac10/ticket/8963 https://svn.boost.org/trac10/ticket/8963 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">basic_binary_iprimitive.hpp.patch</span> </li> </ul> Ticket Robert Ramey Tue, 20 Aug 2013 21:51:11 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/8963#comment:1 https://svn.boost.org/trac10/ticket/8963#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> patch applied in trunk by John Maddock </p> Ticket