Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If your project is going to be compiled only using the Visual Studio you can replace call to <strong>sgetn</strong> (from the line of warning) on <strong><a href="http://msdn.microsoft.com/en-us/library/aa985925%28VS.80%29.aspx" rel="nofollow">_Sgetn_s</a></strong> and duplicate the last parameter of the initial call. That way you will transform call into the safe one.</p> <p>Or you can go with patch provided below, it applies <strong><a href="http://msdn.microsoft.com/en-us/library/aa985925%28VS.80%29.aspx" rel="nofollow">_Sgetn_s</a></strong> for VC 8.0 and higher, but leaves <strong>sgetn</strong> for all other compilers.</p> <pre><code>Index: basic_binary_iprimitive.hpp =================================================================== @@ -143,6 +143,11 @@ void load_binary(void *address, std::size_t count); }; +#if defined(_MSC_VER) &amp;&amp; (_MSC_VER &gt;= 1400) //VC 8.0 + +# define BOOST_sgetn_safe( buf, count ) _Sgetn_s( buf, count, count ) +#else +# define BOOST_sgetn_safe( buf, count ) sgetn( buf, count ) +#endif template&lt;class Archive, class Elem, class Tr&gt; inline void @@ -157,6 +162,7 @@ ); std::streamsize s = static_cast&lt;std::streamsize&gt;(count / sizeof(Elem)); - std::streamsize scount = m_sb.sgetn( + std::streamsize scount = m_sb.BOOST_sgetn_safe( static_cast&lt;Elem *&gt;(address), s ); @@ -173,7 +179,7 @@ // archive_exception(archive_exception::stream_error) // ); Elem t; - scount = m_sb.sgetn(&amp; t, 1); + scount = m_sb.BOOST_sgetn_safe(&amp; t, 1); if(scount != 1) boost::serialization::throw_exception( archive_exception(archive_exception::input_stream_error) @@ -181,6 +187,7 @@ std::memcpy(static_cast&lt;char*&gt;(address) + (count - s), &amp;t, s); } } +#undef BOOST_sgetn_safe } // namespace archive } // namespace boost </code></pre>
 

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