id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 1229,[GCC] compiler warning: comparison between signed and unsigned integer expressions,Dean Michael Berris ,Robert Ramey,"I've attached the warning generated during compilation of the Serialization library. {{{ gcc.compile.c++ /usr/local/lib/boost/bin.v2/libs/serialization/build/gcc-4.1.2/debug/link-static/optimization-speed/threading-multi/binary_iarchive.o /usr/local/lib/boost/boost/archive/basic_binary_iprimitive.hpp: In member function void boost::archive::basic_binary_iprimitive::load_binary(void*, size_t) [with Archive = boost::archive::naked_binary_iarchive, Elem = char, Tr = std::char_traits]: /usr/local/lib/boost/libs/serialization/src/binary_iarchive.cpp:24: instantiated from here /usr/local/lib/boost/boost/archive/basic_binary_iprimitive.hpp:163: warning: comparison between signed and unsigned integer expressions /usr/local/lib/boost/boost/archive/basic_binary_iprimitive.hpp: In member function void boost::archive::basic_binary_iprimitive::load_binary(void*, size_t) [with Archive = boost::archive::binary_iarchive, Elem = char, Tr = std::char_traits]: /usr/local/lib/boost/libs/serialization/src/binary_iarchive.cpp:38: instantiated from here /usr/local/lib/boost/boost/archive/basic_binary_iprimitive.hpp:163: warning: comparison between signed and unsigned integer expressions }}} GCC Compiler version 4.1.2 . I suspect the problem has something to do with the GNU GCC's definition of 'streamsize' as: {{{ /// Integral type for I/O operation counts and buffer sizes. typedef ptrdiff_t streamsize; // Signed integral type }}} -- from bits/postypes.h The warning is caused by the following code: {{{ std::streamsize s = count / sizeof(Elem); std::streamsize scount = m_sb.sgetn( static_cast(address), s ); if(scount != static_cast(s)) boost::throw_exception( archive_exception(archive_exception::stream_error) ); }}} Changing 'std::size_t' into 'std::streamsize' seems to resolve the problem. ",Bugs,closed,Boost 1.35.0,serialization,Boost Development Trunk,Cosmetic,fixed,"serialization, compiler warnings",