Boost logo

Boost :

From: Adam Badura (abadura_at_[hidden])
Date: 2008-01-22 04:12:14


    When I use boost::serialization on MS VS 2005 I have some warnings even
on level 3. The warnings are:

1) warning C4267: 'argument' : conversion from 'size_t' to
'std::streamsize', possible loss of data
j:\thirdparty\boost_1_34_1\boost\archive\basic_binary_oprimitive.hpp 136

2) warning C4267: 'initializing' : conversion from 'size_t' to
'std::streamsize', possible loss of data
j:\thirdparty\boost_1_34_1\boost\archive\basic_binary_iprimitive.hpp 144

3) warning C4267: '=' : conversion from 'size_t' to 'std::streamsize',
possible loss of data
j:\thirdparty\boost_1_34_1\boost\archive\basic_binary_iprimitive.hpp 154

4) warning C4267: 'initializing' : conversion from 'size_t' to 'unsigned
int', possible loss of data
j:\thirdparty\boost_1_34_1\boost\serialization\collections_save_imp.hpp 38
[And this seems to me an obvious error, the variable "count" should be
declared as "Container::size_type".]

5) warning C4996: 'std::basic_streambuf<_Elem,_Traits>::sgetn': Function
call with parameters that may be unsafe - this call relies on the caller to
check that the passed values are correct. To disable this warning,
use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++
'Checked Iterators'
j:\thirdparty\boost_1_34_1\boost\archive\basic_binary_iprimitive.hpp 148
[This seems to be MS specific problem which should be solved on project
level.]

6 ) warning C4996: 'std::basic_streambuf<_Elem,_Traits>::sgetn': Function
call with parameters that may be unsafe - this call relies on the caller to
check that the passed values are correct. To disable this warning,
use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++
'Checked Iterators'
j:\thirdparty\boost_1_34_1\boost\archive\basic_binary_iprimitive.hpp 159
[This seems to be MS specific problem which should be solved on project
level.]

    Can anything be done (especially in case of warning 1-4)?

    Adam Badura


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk