Boost C++ Libraries: Ticket #5706: Gcc 4.6 warnings for Boost Graph https://svn.boost.org/trac10/ticket/5706 <p> Dear authors, </p> <p> Compiling our applications with newest gcc-4.6- some warnings regarding boost graph are displayed. We would appreciate if you could silence them. </p> <p> Please find below gcc output </p> <p> Ubuntu oneiric 64 bits boost 1.47/ trunk , gcc Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper Target: x86_64-linux-gnu </p> <pre class="wiki"> /adnet/boost-1.47.0/include/boost/graph/detail/adj_list_edge_iterator.hpp: In member function ‘void boost::vec_adj_list_impl&lt;Graph, Config, Base&gt;::copy_impl(const boost::vec_adj_list_impl&lt;Graph, Config, Base&gt;&amp;) [with Graph = boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::directedS, pce::te::node_te_attributes, pce::te::link_te_attributes, pce::te::graph_te_attributes, boost::listS&gt;, Config = boost::detail::adj_list_gen&lt;boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::directedS, pce::te::node_te_attributes, pce::te::link_te_attributes, pce::te::graph_te_attributes, boost::listS&gt;, boost::vecS, boost::vecS, boost::directedS, boost::property&lt;boost::vertex_bundle_t, pce::te::node_te_attributes, boost::no_property&gt;, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt;, pce::te::graph_te_attributes, boost::listS&gt;::config, Base = boost::directed_graph_helper&lt;boost::detail::adj_list_gen&lt;boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::directedS, pce::te::node_te_attributes, pce::te::link_te_attributes, pce::te::graph_te_attributes, boost::listS&gt;, boost::vecS, boost::vecS, boost::directedS, boost::property&lt;boost::vertex_bundle_t, pce::te::node_te_attributes, boost::no_property&gt;, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt;, pce::te::graph_te_attributes, boost::listS&gt;::config&gt;, boost::vec_adj_list_impl&lt;Graph, Config, Base&gt; = boost::vec_adj_list_impl&lt;boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::directedS, pce::te::node_te_attributes, pce::te::link_te_attributes, pce::te::graph_te_attributes, boost::listS&gt;, boost::detail::adj_list_gen&lt;boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::directedS, pce::te::node_te_attributes, pce::te::link_te_attributes, pce::te::graph_te_attributes, boost::listS&gt;, boost::vecS, boost::vecS, boost::directedS, boost::property&lt;boost::vertex_bundle_t, pce::te::node_te_attributes, boost::no_property&gt;, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt;, pce::te::graph_te_attributes, boost::listS&gt;::config, boost::directed_graph_helper&lt;boost::detail::adj_list_gen&lt;boost::adjacency_list&lt;boost::vecS, boost::vecS, boost::directedS, pce::te::node_te_attributes, pce::te::link_te_attributes, pce::te::graph_te_attributes, boost::listS&gt;, boost::vecS, boost::vecS, boost::directedS, boost::property&lt;boost::vertex_bundle_t, pce::te::node_te_attributes, boost::no_property&gt;, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt;, pce::te::graph_te_attributes, boost::listS&gt;::config&gt; &gt;]’: /adnet/boost-1.47.0/include/boost/graph/detail/adj_list_edge_iterator.hpp:95:84: warning: ‘*((void*)&amp; ei_end +32)’ may be used uninitialized in this function [-Wuninitialized] /adnet/boost-1.47.0/include/boost/graph/detail/adjacency_list.hpp:2128:27: note: ‘*((void*)&amp; ei_end +32)’ was declared here /adnet/boost-1.47.0/include/boost/graph/detail/adj_list_edge_iterator.hpp:70:9: warning: ‘*((void*)(&amp; ei)+48).__gnu_cxx::__normal_iterator&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt;*, std::vector&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt;, std::allocator&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt; &gt; &gt; &gt;::_M_current’ may be used uninitialized in this function [-Wuninitialized] /adnet/boost-1.47.0/include/boost/graph/detail/adjacency_list.hpp:2128:23: note: ‘*((void*)(&amp; ei)+48).__gnu_cxx::__normal_iterator&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt;*, std::vector&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt;, std::allocator&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt; &gt; &gt; &gt;::_M_current’ was declared here /adnet/boost-1.47.0/include/boost/graph/detail/adjacency_list.hpp:2117:19: warning: ‘*((void*)(&amp; ei)+32).__gnu_cxx::__normal_iterator&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt;*, std::vector&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt;, std::allocator&lt;boost::detail::sep_&lt;long unsigned int, boost::property&lt;boost::edge_bundle_t, pce::te::link_te_attributes, boost::no_property&gt; &gt; &gt; &gt; &gt;::_M_current’ may be used uninitialized in this function [-Wuninitialized] </pre><p> Thank you in advance and best regards </p> <p> R. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/5706 Trac 1.4.3 Jeremiah Willcock Sun, 17 Jul 2011 11:32:32 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/5706#comment:1 https://svn.boost.org/trac10/ticket/5706#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> It looks like you are hitting <a class="ext-link" href="http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47679"><span class="icon">​</span>http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47679</a>; it is not a problem with Boost at all, although there is a workaround to silence the warnings at that link. </p> Ticket Timmie Smith <timmie@…> Tue, 17 Dec 2013 16:24:36 GMT <link>https://svn.boost.org/trac10/ticket/5706#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5706#comment:2</guid> <description> <p> The warnings are still displayed using gcc 4.7.2 -O3 on Fedora. </p> <p> In boost/graph/detail/adj_list_edge_iterator.hpp boost::detail::adj_list_edge_iterator::operator!= is implemented as </p> <pre class="wiki"> inline bool operator!=(const self&amp; x) const { return vCurr != x.vCurr || (vCurr != vEnd &amp;&amp; edges BOOST_GRAPH_MEMBER first != x.edges BOOST_GRAPH_MEMBER first); </pre><p> The unconditional access of this-&gt;edges.first and x.edges.first is incorrect in my opinion, as the edges data member in either instance may be uninitialized. </p> <p> Patching the operator to first check if the edges data members are initialized eliminates the warning and the evaluation should short circuit in the case that they aren't, eliminating the access of edges.first if edges isn't initialized. </p> <pre class="wiki"> inline bool operator!=(const self&amp; x) const { return vCurr != x.vCurr || (vCurr != vEnd &amp;&amp; edges &amp;&amp; x.edges &amp;&amp; edges BOOST_GRAPH_MEMBER first != x.edges BOOST_GRAPH_MEMBER first); </pre> </description> <category>Ticket</category> </item> <item> <author>Timmie Smith <timmie@…></author> <pubDate>Tue, 17 Dec 2013 16:26:00 GMT</pubDate> <title>status, milestone changed; resolution deleted https://svn.boost.org/trac10/ticket/5706#comment:3 https://svn.boost.org/trac10/ticket/5706#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">wontfix</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.48.0</span> → <span class="trac-field-new">Boost 1.56.0</span> </li> </ul> Ticket Murray Cumming <murrayc@…> Tue, 09 Aug 2016 09:24:10 GMT <link>https://svn.boost.org/trac10/ticket/5706#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5706#comment:4</guid> <description> <p> Is this still a problem? </p> </description> <category>Ticket</category> </item> <item> <author>timmie@…</author> <pubDate>Tue, 24 Jan 2017 20:26:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/5706#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/5706#comment:5</guid> <description> <p> It looks like this is still a problem, yes. The file has not been modified since Boost 1.56. </p> </description> <category>Ticket</category> </item> </channel> </rss>