[Boost-bugs] [Boost C++ Libraries] #8601: GCC 4.7.3 prints warning [-Wmaybe-uninitialized] for multi_array.hpp

Subject: [Boost-bugs] [Boost C++ Libraries] #8601: GCC 4.7.3 prints warning [-Wmaybe-uninitialized] for multi_array.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-21 12:39:43


#8601: GCC 4.7.3 prints warning [-Wmaybe-uninitialized] for multi_array.hpp
--------------------------------------------------+-------------------------
 Reporter: Torquil Sørensen <torquil@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.53.0
 Severity: Problem | Keywords:
--------------------------------------------------+-------------------------
 When compiling the attached test case program using Boost 1.53.0 and GCC
 4.7.3:

 {{{
 g++ -Wall -O2 -DBOOST_DISABLE_ASSERTS -I/path/to/include/dir test_prog.cpp
 }}}

 where test_prog.cpp is


 {{{
 #include "boost/multi_array.hpp"

 int main()
 {
         boost::multi_array<int,1> A;
         A.resize(boost::extents[2]);
         A[0] = 0;
         A[1] = 0;
         return(0);
 }
 }}}

 I get the following warning:


 {{{
 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<T, NumDims, Allocator>& boost::multi_array<T,
 NumDims, Allocator>::resize(const
 boost::detail::multi_array::extent_gen<NumDims>&) [with T = int; long
 unsigned int NumDims = 1ul; Allocator = std::allocator<int>;
 boost::multi_array<T, NumDims, Allocator> = boost::multi_array<int,
 1ul>]’:
 /mn/anatu/cma-u3/tmac/usr/include/boost/multi_array.hpp:401:16: warning:
 â€˜new_strides.boost::array<long int, 1ul>::elems[0ul]’ may be used
 uninitialized in this function [-Wmaybe-uninitialized]
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8601>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC