Boost logo

Boost Users :

Subject: [Boost-users] [Graph] Warning with boost 1.54, but not with 1.46.1 or 1.55
From: Vicky Vergara (vicky_vergara_at_[hidden])
Date: 2015-07-22 13:35:46

I have, with this code:
100: graph_traits<graph_t>::edge_iterator ei, eend;
101: for (tie(ei, eend) = boost::edges(graph); ei != eend; ei++) {

I know this is not a major problem, as for the final release I will remove the -Wall flag from the compilation
But then my question is why is the difference?

Using boost 1.54 under Ubuntu 14.04 this warning shows on line 100 about variable ei

/home/woodbri/work/pgrouting/src/apsp_johnson/src/apsp_johnson_boost_wrapper.cpp:100:40: warning:
 '*((void*)(& ei)+32).__gnu_cxx::__normal_iterator<boost::detail::stored_edge_property<long unsigned int, Edge>*, std::vector<boost::detail::stored_edge_property<long unsigned int, Edge>,
std::allocator<boost::detail::stored_edge_property<long unsigned int, Edge> > > >::
_M_current' may be used uninitialized in this function [-Wmaybe-uninitialized] graph_traits<graph_t>::edge_iterator ei, eend;

the complete code can be found :

in the cmake the compiler flags are set like this:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -O2 -g -Wall -std=c++0x -frounding-math -Wno-deprecated")

Complete setup can be found:

This is a test that has boost 1.46.1, no warning shows I also don't get a warning with boost 1.55

The complete conversation of the problem can be found here:


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at