Note that there are some explanatory texts on larger screens.

plurals
  1. POBoost serialization: safe to ignore warning?
    primarykey
    data
    text
    <p>I started to use boost's serialization code to write data to a binary stream. I get the following warnings which could be disabled (<code>D_SCL_SECURE_NO_WARNINGS</code>) but I wonder if it is safe to do so? How can I get more specific information which code of mine causes the warning? I only know the .cpp file.</p> <p>This is the output from Visual Studio 2008:</p> <pre><code>4&gt;g:\winlib\boost\1_42_0\boost/archive/basic_binary_iprimitive.hpp(162) : warng C4996: 'std::basic_streambuf&lt;_Elem,_Traits&gt;::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' 4&gt; with 4&gt; [ 4&gt; _Elem=char, 4&gt; _Traits=std::char_traits&lt;char&gt; 4&gt; ] 4&gt; E:\Visual Studio 9.0\VC\include\streambuf(121) : see declaration of 'std::basic_streambuf&lt;_Elem,_Traits&gt;::sgetn' 4&gt; with 4&gt; [ 4&gt; _Elem=char, 4&gt; _Traits=std::char_traits&lt;char&gt; 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\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)' 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; Elem=char, 4&gt; Tr=std::char_traits&lt;char&gt; 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/iserializer.hpp(107) : see reference to function template instantiation 'void boost::archive::basic_binary_iprimitive&lt;Archive,Elem,Tr&gt;::load&lt;T&gt;(T &amp;)' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; Elem=char, 4&gt; Tr=std::char_traits&lt;char&gt;, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/iserializer.hpp(356) : see reference to function template instantiation 'void boost::archive::load_access::load_primitive&lt;Archive,T&gt;(Archive &amp;,T &amp;)' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/iserializer.hpp(433) : 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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/iserializer.hpp(580) : 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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/common_iarchive.hpp(68) : see reference to function template instantiation 'void boost::archive::load&lt;Archive,T&gt;(Archive &amp;,T &amp;)' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/basic_binary_iarchive.hpp(67) : 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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/interface_iarchive.hpp(61) : 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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; Elem=char, 4&gt; Tr=std::char_traits&lt;char&gt;, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/basic_binary_iarchive.hpp(77) : see reference to function template instantiation 'Archive &amp;boost::archive::detail::interface_iarchive&lt;Archive&gt;::operator &gt;&gt;&lt;unsigned char&gt;(T &amp;)' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/basic_binary_iarchive.hpp(74) : while compiling class template member function 'void boost::archive::basic_binary_iarchive&lt;Archive&gt;::load_override(boost::archive::version_type &amp;,int)' 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/binary_iarchive_impl.hpp(36) : see reference to class template instantiation 'boost::archive::basic_binary_iarchive&lt;Archive&gt;' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/binary_iarchive.hpp(42) : see reference to class template instantiation 'boost::archive::binary_iarchive_impl&lt;Archive,Elem,Tr&gt;' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::naked_binary_iarchive, 4&gt; Elem=char, 4&gt; Tr=std::char_traits&lt;char&gt; 4&gt; ] 4&gt;g:\winlib\boost\1_42_0\boost/archive/basic_binary_iprimitive.hpp(176) : warning C4996: 'std::basic_streambuf&lt;_Elem,_Traits&gt;::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' 4&gt; with 4&gt; [ 4&gt; _Elem=char, 4&gt; _Traits=std::char_traits&lt;char&gt; 4&gt; ] 4&gt; E:\Visual Studio 9.0\VC\include\streambuf(121) : see declaration of 'std::basic_streambuf&lt;_Elem,_Traits&gt;::sgetn' 4&gt; with 4&gt; [ 4&gt; _Elem=char, 4&gt; _Traits=std::char_traits&lt;char&gt; 4&gt; ] 4&gt;g:\winlib\boost\1_42_0\boost/archive/basic_binary_iprimitive.hpp(162) : warning C4996: 'std::basic_streambuf&lt;_Elem,_Traits&gt;::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' 4&gt; with 4&gt; [ 4&gt; _Elem=char, 4&gt; _Traits=std::char_traits&lt;char&gt; 4&gt; ] 4&gt; E:\Visual Studio 9.0\VC\include\streambuf(121) : see declaration of 'std::basic_streambuf&lt;_Elem,_Traits&gt;::sgetn' 4&gt; with 4&gt; [ 4&gt; _Elem=char, 4&gt; _Traits=std::char_traits&lt;char&gt; 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\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)' 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; Elem=char, 4&gt; Tr=std::char_traits&lt;char&gt; 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/iserializer.hpp(107) : see reference to function template instantiation 'void boost::archive::basic_binary_iprimitive&lt;Archive,Elem,Tr&gt;::load&lt;T&gt;(T &amp;)' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; Elem=char, 4&gt; Tr=std::char_traits&lt;char&gt;, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/iserializer.hpp(356) : see reference to function template instantiation 'void boost::archive::load_access::load_primitive&lt;Archive,T&gt;(Archive &amp;,T &amp;)' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/iserializer.hpp(433) : 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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/iserializer.hpp(580) : 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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/common_iarchive.hpp(68) : see reference to function template instantiation 'void boost::archive::load&lt;Archive,T&gt;(Archive &amp;,T &amp;)' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/basic_binary_iarchive.hpp(67) : 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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/detail/interface_iarchive.hpp(61) : 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 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; Elem=char, 4&gt; Tr=std::char_traits&lt;char&gt;, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/basic_binary_iarchive.hpp(77) : see reference to function template instantiation 'Archive &amp;boost::archive::detail::interface_iarchive&lt;Archive&gt;::operator &gt;&gt;&lt;unsigned char&gt;(T &amp;)' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; T=unsigned char 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/basic_binary_iarchive.hpp(74) : while compiling class template member function 'void boost::archive::basic_binary_iarchive&lt;Archive&gt;::load_override(boost::archive::version_type &amp;,int)' 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/binary_iarchive_impl.hpp(36) : see reference to class template instantiation 'boost::archive::basic_binary_iarchive&lt;Archive&gt;' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive 4&gt; ] 4&gt; g:\winlib\boost\1_42_0\boost/archive/binary_iarchive.hpp(76) : see reference to class template instantiation 'boost::archive::binary_iarchive_impl&lt;Archive,Elem,Tr&gt;' being compiled 4&gt; with 4&gt; [ 4&gt; Archive=boost::archive::binary_iarchive, 4&gt; Elem=char, 4&gt; Tr=std::char_traits&lt;char&gt; 4&gt; ] 4&gt;g:\winlib\boost\1_42_0\boost/archive/basic_binary_iprimitive.hpp(176) : warning C4996: 'std::basic_streambuf&lt;_Elem,_Traits&gt;::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' 4&gt; with 4&gt; [ 4&gt; _Elem=char, 4&gt; _Traits=std::char_traits&lt;char&gt; 4&gt; ] 4&gt; E:\Visual Studio 9.0\VC\include\streambuf(121) : see declaration of 'std::basic_streambuf&lt;_Elem,_Traits&gt;::sgetn' 4&gt; with 4&gt; [ 4&gt; _Elem=char, 4&gt; _Traits=std::char_traits&lt;char&gt; 4&gt; ] </code></pre> <p>Thanks!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload