Opened 9 years ago

Last modified 9 years ago

#8601 new Bugs

GCC 4.7.3 prints warning [-Wmaybe-uninitialized] for multi_array.hpp

Reported by: Torquil Sørensen <torquil@…> Owned by: Ronald Garcia
Milestone: To Be Determined Component: multi_array
Version: Boost 1.53.0 Severity: Problem
Keywords: Cc:

Description

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]

Change History (1)

comment:1 by viboes, 9 years ago

Component: Nonemulti_array
Owner: set to Ronald Garcia
Note: See TracTickets for help on using tickets.