Opened 9 years ago

Closed 9 years ago

#8963 closed Bugs (fixed)

Warnings from binary archives

Reported by: John Maddock Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

Simply #including:

#include <boost/archive/binary_iarchive.hpp> #include <boost/archive/binary_oarchive.hpp>

Is sufficient to generate several pages of msvc warnings:

1>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>          d:\data\boost\trunk\boost\archive\basic_binary_iprimitive.hpp(152) : while compiling class template member function 'void boost::archive::basic_binary_iprimitive<Archive,Elem,Tr>::load_binary(void *,size_t)'
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              Elem=char,
1>              Tr=std::char_traits<char>
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(362) : see reference to function template instantiation 'void boost::archive::load_access::load_primitive<Archive,T>(Archive &,T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(439) : see reference to function template instantiation 'void boost::archive::detail::load_non_pointer_type<Archive>::load_primitive::invoke<T>(Archive &,T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(592) : see reference to function template instantiation 'void boost::archive::detail::load_non_pointer_type<Archive>::invoke<T>(Archive &,T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(66) : see reference to function template instantiation 'void boost::archive::load<Archive,T>(Archive &,T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\basic_binary_iarchive.hpp(70) : see reference to function template instantiation 'void boost::archive::detail::common_iarchive<Archive>::load_override<T>(T &,int)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\binary_iarchive_impl.hpp(50) : see reference to function template instantiation 'void boost::archive::basic_binary_iarchive<Archive>::load_override<T>(T &,int)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\interface_iarchive.hpp(60) : see reference to function template instantiation 'void boost::archive::binary_iarchive_impl<Archive,Elem,Tr>::load_override<T>(T &,int)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              Elem=char,
1>              Tr=std::char_traits<char>,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(48) : see reference to function template instantiation 'Archive &boost::archive::detail::interface_iarchive<Archive>::operator >><boost::archive::object_id_type>(T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(47) : while compiling class template member function 'void boost::archive::detail::common_iarchive<Archive>::vload(boost::archive::object_id_type &)'
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive
1>          ]
1>          d:\data\boost\trunk\boost\archive\basic_binary_iarchive.hpp(52) : see reference to class template instantiation 'boost::archive::detail::common_iarchive<Archive>' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive
1>          ]
1>          d:\data\boost\trunk\boost\archive\binary_iarchive_impl.hpp(36) : see reference to class template instantiation 'boost::archive::basic_binary_iarchive<Archive>' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive
1>          ]
1>          d:\data\boost\trunk\boost\archive\binary_iarchive.hpp(42) : see reference to class template instantiation 'boost::archive::binary_iarchive_impl<Archive,Elem,Tr>' being compiled
1>          with
1>          [
1>              Archive=boost::archive::naked_binary_iarchive,
1>              Elem=char,
1>              Tr=std::char_traits<char>
1>          ]
1>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>          d:\data\boost\trunk\boost\archive\basic_binary_iprimitive.hpp(152) : while compiling class template member function 'void boost::archive::basic_binary_iprimitive<Archive,Elem,Tr>::load_binary(void *,size_t)'
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              Elem=char,
1>              Tr=std::char_traits<char>
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(362) : see reference to function template instantiation 'void boost::archive::load_access::load_primitive<Archive,T>(Archive &,T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(439) : see reference to function template instantiation 'void boost::archive::detail::load_non_pointer_type<Archive>::load_primitive::invoke<T>(Archive &,T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\iserializer.hpp(592) : see reference to function template instantiation 'void boost::archive::detail::load_non_pointer_type<Archive>::invoke<T>(Archive &,T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(66) : see reference to function template instantiation 'void boost::archive::load<Archive,T>(Archive &,T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\basic_binary_iarchive.hpp(70) : see reference to function template instantiation 'void boost::archive::detail::common_iarchive<Archive>::load_override<T>(T &,int)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\binary_iarchive_impl.hpp(50) : see reference to function template instantiation 'void boost::archive::basic_binary_iarchive<Archive>::load_override<T>(T &,int)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\interface_iarchive.hpp(60) : see reference to function template instantiation 'void boost::archive::binary_iarchive_impl<Archive,Elem,Tr>::load_override<T>(T &,int)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              Elem=char,
1>              Tr=std::char_traits<char>,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(48) : see reference to function template instantiation 'Archive &boost::archive::detail::interface_iarchive<Archive>::operator >><boost::archive::object_id_type>(T &)' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              T=boost::archive::object_id_type
1>          ]
1>          d:\data\boost\trunk\boost\archive\detail\common_iarchive.hpp(47) : while compiling class template member function 'void boost::archive::detail::common_iarchive<Archive>::vload(boost::archive::object_id_type &)'
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive
1>          ]
1>          d:\data\boost\trunk\boost\archive\basic_binary_iarchive.hpp(52) : see reference to class template instantiation 'boost::archive::detail::common_iarchive<Archive>' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive
1>          ]
1>          d:\data\boost\trunk\boost\archive\binary_iarchive_impl.hpp(36) : see reference to class template instantiation 'boost::archive::basic_binary_iarchive<Archive>' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive
1>          ]
1>          d:\data\boost\trunk\boost\archive\binary_iarchive.hpp(76) : see reference to class template instantiation 'boost::archive::binary_iarchive_impl<Archive,Elem,Tr>' being compiled
1>          with
1>          [
1>              Archive=boost::archive::binary_iarchive,
1>              Elem=char,
1>              Tr=std::char_traits<char>
1>          ]

The attached patch fixes the warning.

Attachments (1)

basic_binary_iprimitive.hpp.patch (572 bytes ) - added by John Maddock 9 years ago.

Download all attachments as: .zip

Change History (2)

by John Maddock, 9 years ago

comment:1 by Robert Ramey, 9 years ago

Resolution: fixed
Status: newclosed

patch applied in trunk by John Maddock

Note: See TracTickets for help on using tickets.