Boost C++ Libraries: Ticket #2444: read_dimacs problem with gcc 4.3 https://svn.boost.org/trac10/ticket/2444 <p> gcc version and system: g++ (Debian 4.3.1-9) 4.3.1 </p> <p> I tried to compile the graph example (boost/libs/graph/example/graph.cpp) using the following command: g++ -Wall -I /cs/phd/freiman/include/boost_1_36_0 graph.cpp -o graph </p> <p> and got the following message about deprecated headers: </p> <hr /> <hr /> <p> In file included from /usr/include/c++/4.3/backward/hash_set:64, </p> <blockquote> <p> from </p> </blockquote> <p> /cs/phd/freiman/include/boost_1_36_0/boost/graph/adjacency_list.hpp:22, </p> <blockquote> <p> from graph.cpp:15: </p> </blockquote> <p> /usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. </p> <hr /> <hr /> <p> The running of this file was o.k. </p> <p> When I tried to compile the kolmogorov max-flow example (boost/libs/graph/example/kolmogorov-eg.cpp) using the following command: </p> <blockquote> <p> g++ -Wall -I /cs/phd/freiman/include/boost_1_36_0 kolmogorov-eg.cpp -o </p> </blockquote> <p> kolmogorov-eg </p> <p> I got the following: </p> <hr /> <hr /> <p> In file included from /usr/include/c++/4.3/backward/hash_set:64, </p> <blockquote> <p> from </p> </blockquote> <p> /cs/phd/freiman/include/boost_1_36_0/boost/graph/adjacency_list.hpp:22, </p> <blockquote> <p> from kolmogorov-eg.cpp:36: </p> </blockquote> <p> /usr/include/c++/4.3/backward/backward_warning.h:33:2: warning: #warning This file includes at least one deprecated or antiquated header which may be removed without further notice at a future date. Please use a non-deprecated interface with equivalent functionality instead. For a listing of replacement headers and interfaces, consult the file backward_warning.h. To disable this warning use -Wno-deprecated. In file included from kolmogorov-eg.cpp:37: /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp: In function 'int boost::read_dimacs_max_flow(Graph&amp;, <a class="missing wiki">CapacityMap</a>, <a class="missing wiki">ReverseEdgeMap</a>, typename boost::graph_traits&lt;G&gt;::vertex_descriptor&amp;, typename boost::graph_traits&lt;G&gt;::vertex_descriptor&amp;, std::istream&amp;)': /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:140: error: there are no arguments to 'strcmp' that depend on a template parameter, so a declaration of 'strcmp' must be available /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:140: error: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated) /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp: In function 'int boost::read_dimacs_max_flow(Graph&amp;, <a class="missing wiki">CapacityMap</a>, <a class="missing wiki">ReverseEdgeMap</a>, typename boost::graph_traits&lt;G&gt;::vertex_descriptor&amp;, typename boost::graph_traits&lt;G&gt;::vertex_descriptor&amp;, std::istream&amp;) [with Graph = main()::Graph, <a class="missing wiki">CapacityMap</a> = boost::adj_list_edge_property_map&lt;boost::directed_tag, long int, long int&amp;, unsigned int, boost::property&lt;boost::edge_capacity_t, long int, boost::property&lt;boost::edge_residual_capacity_t, long int, boost::property&lt;boost::edge_reverse_t, boost::detail::edge_desc_impl&lt;boost::directed_tag, unsigned int&gt;, boost::no_property&gt; &gt; &gt;, boost::edge_capacity_t&gt;, <a class="missing wiki">ReverseEdgeMap</a> = boost::adj_list_edge_property_map&lt;boost::directed_tag, boost::detail::edge_desc_impl&lt;boost::directed_tag, unsigned int&gt;, boost::detail::edge_desc_impl&lt;boost::directed_tag, unsigned int&gt;&amp;, unsigned int, boost::property&lt;boost::edge_capacity_t, long int, boost::property&lt;boost::edge_residual_capacity_t, long int, boost::property&lt;boost::edge_reverse_t, boost::detail::edge_desc_impl&lt;boost::directed_tag, unsigned int&gt;, boost::no_property&gt; &gt; &gt;, boost::edge_reverse_t&gt;]': kolmogorov-eg.cpp:93: instantiated from here /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:105: warning: deprecated conversion from string constant to 'char*' kolmogorov-eg.cpp:93: instantiated from here /cs/phd/freiman/include/boost_1_36_0/boost/graph/read_dimacs.hpp:140: error: 'strcmp' was not declared in this scope </p> <hr /> <hr /> <p> which has error due to the strcmp function in line 140 in the file: read_dimacs.hpp I added the required header file (string.h) and only the warnings remain. </p> <p> When I tried to run this example using the following command: </p> <p> kolmogorov-eg &lt; max_flow.dat </p> <p> I got a segmentation fault: </p> <p> I tried to understand where the seg. fault came from using valgrind and it runs without seg. fault but with many "invalid read" errors, that seems to come from the file read_dimacs.hpp, line 118 </p> <p> Using the same code with WinXP and visual studio 2003, yields no problems. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2444 Trac 1.4.3 Jürgen Hunold Wed, 29 Oct 2008 12:49:23 GMT <link>https://svn.boost.org/trac10/ticket/2444#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2444#comment:1</guid> <description> <p> Simply #define BOOST_NO_HASH. This will disable hash_* support of the BGL and thus silence the warnings. I've done this here. </p> <p> That would be nice if Boost.Config could detect this. Unfortunately, the new headers are only available with --std=cxx0x and this opens a new can of worms... </p> </description> <category>Ticket</category> </item> <item> <author>freiman@…</author> <pubDate>Wed, 29 Oct 2008 12:53:21 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/2444#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2444#comment:2</guid> <description> <p> Solved only the first warning, and not the: "deprecated conversion from string constant to 'char*" in read_dimacs.hpp line 105. In addition the seg. fault from the kolmogorov-eg example was not solved by this. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Andrew Sutton</dc:creator> <pubDate>Mon, 03 Nov 2008 14:56:04 GMT</pubDate> <title>component changed; owner set https://svn.boost.org/trac10/ticket/2444#comment:3 https://svn.boost.org/trac10/ticket/2444#comment:3 <ul> <li><strong>owner</strong> set to <span class="trac-author">Andrew Sutton</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">graph</span> </li> </ul> Ticket Andrew Sutton Mon, 03 Nov 2008 15:03:15 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/2444#comment:4 https://svn.boost.org/trac10/ticket/2444#comment:4 <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">fixed</span> </li> </ul> <p> (In <a class="changeset" href="https://svn.boost.org/trac10/changeset/49554" title="Added a compiler check to adjacency_list.hpp that checks for GCC &gt;= ...">[49554]</a>) Added a compiler check to adjacency_list.hpp that checks for GCC &gt;= 4.3 and defines BOOST_NO_HASH. Closes <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2444" title="#2444: Bugs: read_dimacs problem with gcc 4.3 (closed: fixed)">#2444</a>. </p> Ticket Andrew Sutton Mon, 03 Nov 2008 15:19:32 GMT milestone changed https://svn.boost.org/trac10/ticket/2444#comment:5 https://svn.boost.org/trac10/ticket/2444#comment:5 <ul> <li><strong>milestone</strong> <span class="trac-field-old">Boost 1.37.0</span> → <span class="trac-field-new">Boost 1.38.0</span> </li> </ul> <p> Note that this fix (<a class="changeset" href="https://svn.boost.org/trac10/changeset/49554" title="Added a compiler check to adjacency_list.hpp that checks for GCC &gt;= ...">r49554</a>) will break any code that uses hash* selectors under GCC &gt;= 4.3 - which is probably the right thing to do since hash_* was deprecated in favor of the unordered* data structures in tr1/0x. See <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/2467" title="#2467: Tasks: Implement unordered storage selectors (closed: fixed)">#2467</a> for more information. </p> Ticket Andrew Sutton Mon, 08 Dec 2008 14:57:21 GMT <link>https://svn.boost.org/trac10/ticket/2444#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2444#comment:6</guid> <description> <p> Reverted previous compiler check (<a class="changeset" href="https://svn.boost.org/trac10/changeset/49554" title="Added a compiler check to adjacency_list.hpp that checks for GCC &gt;= ...">r49554</a>). It's probably not a good idea to deprecate these. Will add documentation on how to get around warnings. </p> </description> <category>Ticket</category> </item> </channel> </rss>