This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/38851] [4.4 regression] Compiler warns about uninitialized variable that is an object with a constructor
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Jan 2009 19:31:50 -0000
- Subject: [Bug middle-end/38851] [4.4 regression] Compiler warns about uninitialized variable that is an object with a constructor
- References: <bug-38851-17188@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from bangerth at dealii dot org 2009-01-23 19:31 -------
I see this as well. It triggers a lot when using boost::graph which
uses empty classes as tags all over the place. A simple case with
boost::graph would be this:
--------------------------
#include <boost/graph/adjacency_list.hpp>
using namespace boost;
adjacency_list<vecS, vecS, undirectedS,
property<vertex_color_t, default_color_type,
property<vertex_degree_t,int> > > g;
void create_graph () { add_edge(1,2, g); }
--------------------------
boost/graph/detail/adjacency_list.hpp: In function 'void create_graph()':
boost/graph/detail/adjacency_list.hpp:819: warning: 'p' may be used
uninitialized in this function
boost/graph/detail/adjacency_list.hpp:2210: note: 'p' was declared here
This problem makes -Wuninitialize pretty much useless for anyone who uses
boost::graph. I think it would be a shame if we shipped a compiler that
has a problem with this.
W.
--
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mmitchel at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38851