Boost C++ Libraries: Ticket #6742: C4789 warning using boost range on visual 2010 https://svn.boost.org/trac10/ticket/6742 <p> Hello, </p> <p> I am compiling under Windows XP using Visual Studio 2010. </p> <p> When I use boost::range, I have some strange compilation warning "warning C4789: destination of memory copy is too small". </p> <p> Here is a small unit test that reproduces this warning: </p> <pre class="wiki">#define BOOST_TEST_MODULE boost_range_c4789_test #include &lt;boost/phoenix/core.hpp&gt; #include &lt;boost/phoenix/operator.hpp&gt; #include &lt;boost/range.hpp&gt; #include &lt;boost/range/adaptors.hpp&gt; #include &lt;boost/range/algorithm.hpp&gt; #include &lt;boost/range/algorithm_ext.hpp&gt; #include &lt;boost/test/unit_test.hpp&gt; #include &lt;vector&gt; /** \deftestgroup{boost_range_c4789_test} \brief Test a spurious C4789 MSVC warning that happens with boost range @{ **/ struct FooType { double a,b; }; //----------------------------------------------------------------------------- /** \testdesc The actual test **/ BOOST_AUTO_TEST_CASE( boost_range_c4789_bug ) { using namespace boost::phoenix::arg_names; using namespace boost::adaptors; FooType foo; foo.a = 2.; foo.b = -4.; size_t numelem = 10; std::vector&lt;FooType&gt; foovec(numelem,foo); std::vector&lt;double&gt; barvec; boost::push_back( barvec, foovec | transformed( (&amp;arg1)-&gt;*&amp; FooType::a ) ); BOOST_CHECK( barvec == std::vector&lt;double&gt;(numelem,foo.a) ); } ///@} </pre><p> Thanks for your help, </p> <p> Benjamin. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/6742 Trac 1.4.3 Neil Groves Wed, 26 Feb 2014 22:10:50 GMT status changed https://svn.boost.org/trac10/ticket/6742#comment:1 https://svn.boost.org/trac10/ticket/6742#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Neil Groves Mon, 03 Mar 2014 14:19:16 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/6742#comment:2 https://svn.boost.org/trac10/ticket/6742#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Other fixes appear to have solved this issue. A test case has been added and this compiles cleanly on all platforms available to me (linux with GCC / Clang and OS-X Clang). </p> Ticket