Boost C++ Libraries: Ticket #8601: GCC 4.7.3 prints warning [-Wmaybe-uninitialized] for multi_array.hpp https://svn.boost.org/trac10/ticket/8601 <p> When compiling the attached test case program using Boost 1.53.0 and GCC 4.7.3: </p> <pre class="wiki">g++ -Wall -O2 -DBOOST_DISABLE_ASSERTS -I/path/to/include/dir test_prog.cpp </pre><p> where test_prog.cpp is </p> <pre class="wiki">#include "boost/multi_array.hpp" int main() { boost::multi_array&lt;int,1&gt; A; A.resize(boost::extents[2]); A[0] = 0; A[1] = 0; return(0); } </pre><p> I get the following warning: </p> <pre class="wiki">In file included from test_prog.cpp:1:0: /mn/anatu/cma-u3/tmac/usr/include/boost/multi_array.hpp: In member function ‘boost::multi_array&lt;T, NumDims, Allocator&gt;&amp; boost::multi_array&lt;T, NumDims, Allocator&gt;::resize(const boost::detail::multi_array::extent_gen&lt;NumDims&gt;&amp;) [with T = int; long unsigned int NumDims = 1ul; Allocator = std::allocator&lt;int&gt;; boost::multi_array&lt;T, NumDims, Allocator&gt; = boost::multi_array&lt;int, 1ul&gt;]’: /mn/anatu/cma-u3/tmac/usr/include/boost/multi_array.hpp:401:16: warning: ‘new_strides.boost::array&lt;long int, 1ul&gt;::elems[0ul]’ may be used uninitialized in this function [-Wmaybe-uninitialized] </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/8601 Trac 1.4.3 viboes Sat, 25 May 2013 13:38:20 GMT component changed; owner set https://svn.boost.org/trac10/ticket/8601#comment:1 https://svn.boost.org/trac10/ticket/8601#comment:1 <ul> <li><strong>owner</strong> set to <span class="trac-author">Ronald Garcia</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">multi_array</span> </li> </ul> Ticket