clang-include-graph
clang-include-graph copied to clipboard
boost compiler warnings
When compiling clang-include-graph with clang 14 and boost 1.74 (on Debian bookworm), I get the following compiler warnings from a couple of the source files:
[ 8%] Building CXX object CMakeFiles/lib-clang-include-graph.dir/src/include_graph.cc.o
In file included from /usr/include/boost/graph/detail/adjacency_list.hpp:35,
from /usr/include/boost/graph/adjacency_list.hpp:255,
from /home/hamish/src/clang-include-graph/src/include_graph.h:24,
from /home/hamish/src/clang-include-graph/src/include_graph.cc:19:
In member function ‘boost::detail::adj_list_edge_iterator<VertexIterator, OutEdgeIterator, Graph>::self& boost::detail::adj_list_edge_iterator<VertexIterator, OutEdgeIterator, Graph>::operator++() [with VertexIterator = boost::range_detail::integer_iterator<long unsigned int>; OutEdgeIterator = boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>; Graph = boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>]’,
inlined from ‘void boost::vec_adj_list_impl<Graph, Config, Base>::copy_impl(const boost::vec_adj_list_impl<Graph, Config, Base>&) [with Graph = boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>; Config = boost::detail::adj_list_gen<boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>, boost::vecS, boost::setS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS>::config; Base = boost::directed_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>, boost::vecS, boost::setS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS>::config>]’ at /usr/include/boost/graph/detail/adjacency_list.hpp:2193:63:
/usr/include/boost/graph/detail/adj_list_edge_iterator.hpp:80:13: warning: ‘((const std::_Self*)((char*)&ei + offsetof(boost::detail::edge_iterator, boost::detail::adj_list_edge_iterator<boost::range_detail::integer_iterator<long unsigned int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS> >::edges.boost::optional<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::<unnamed>.boost::optional_detail::optional_base<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::m_storage.boost::optional_detail::aligned_storage<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::dummy_)))[2].std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >::_M_node’ may be used uninitialized [-Wmaybe-uninitialized]
80 | if (edges BOOST_GRAPH_MEMBER first
| ^~
/usr/include/boost/graph/detail/adjacency_list.hpp: In member function ‘void boost::vec_adj_list_impl<Graph, Config, Base>::copy_impl(const boost::vec_adj_list_impl<Graph, Config, Base>&) [with Graph = boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>; Config = boost::detail::adj_list_gen<boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>, boost::vecS, boost::setS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS>::config; Base = boost::directed_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>, boost::vecS, boost::setS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS>::config>]’:
/usr/include/boost/graph/detail/adjacency_list.hpp:2192:23: note: ‘((const std::_Self*)((char*)&ei + offsetof(boost::detail::edge_iterator, boost::detail::adj_list_edge_iterator<boost::range_detail::integer_iterator<long unsigned int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS> >::edges.boost::optional<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::<unnamed>.boost::optional_detail::optional_base<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::m_storage.boost::optional_detail::aligned_storage<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::dummy_)))[2].std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >::_M_node’ was declared here
2192 | edge_iterator ei, ei_end;
| ^~
In member function ‘EdgeDescriptor boost::detail::out_edge_iter<BaseIter, VertexDescriptor, EdgeDescriptor, Difference>::dereference() const [with BaseIter = std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >; VertexDescriptor = long unsigned int; EdgeDescriptor = boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>; Difference = long int]’,
inlined from ‘static typename Facade::reference boost::iterators::iterator_core_access::dereference(const Facade&) [with Facade = boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>]’ at /usr/include/boost/iterator/iterator_facade.hpp:631:31,
inlined from ‘boost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::reference boost::iterators::detail::iterator_facade_base<Derived, Value, CategoryOrTraversal, Reference, Difference, false, false>::operator*() const [with Derived = boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>; Value = boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>; CategoryOrTraversal = boost::iterators::bidirectional_traversal_tag; Reference = boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>; Difference = long int]’ at /usr/include/boost/iterator/iterator_facade.hpp:737:53,
inlined from ‘boost::detail::adj_list_edge_iterator<VertexIterator, OutEdgeIterator, Graph>::value_type boost::detail::adj_list_edge_iterator<VertexIterator, OutEdgeIterator, Graph>::operator*() const [with VertexIterator = boost::range_detail::integer_iterator<long unsigned int>; OutEdgeIterator = boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>; Graph = boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>]’ at /usr/include/boost/graph/detail/adj_list_edge_iterator.hpp:99:20,
inlined from ‘void boost::vec_adj_list_impl<Graph, Config, Base>::copy_impl(const boost::vec_adj_list_impl<Graph, Config, Base>&) [with Graph = boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>; Config = boost::detail::adj_list_gen<boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>, boost::vecS, boost::setS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS>::config; Base = boost::directed_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>, boost::vecS, boost::setS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS>::config>]’ at /usr/include/boost/graph/detail/adjacency_list.hpp:2198:51:
/usr/include/boost/graph/detail/adjacency_list.hpp:148:48: warning: ‘*(const std::_Self*)((char*)&ei + offsetof(boost::detail::edge_iterator, boost::detail::adj_list_edge_iterator<boost::range_detail::integer_iterator<long unsigned int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS> >::edges.boost::optional<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::<unnamed>.boost::optional_detail::optional_base<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::m_storage.boost::optional_detail::aligned_storage<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::dummy_)).std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >::_M_node’ may be used uninitialized [-Wmaybe-uninitialized]
148 | &(*this->base()).get_property());
| ^
/usr/include/boost/graph/detail/adjacency_list.hpp: In member function ‘void boost::vec_adj_list_impl<Graph, Config, Base>::copy_impl(const boost::vec_adj_list_impl<Graph, Config, Base>&) [with Graph = boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>; Config = boost::detail::adj_list_gen<boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>, boost::vecS, boost::setS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS>::config; Base = boost::directed_graph_helper<boost::detail::adj_list_gen<boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t>, boost::vecS, boost::setS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS>::config>]’:
/usr/include/boost/graph/detail/adjacency_list.hpp:2192:23: note: ‘*(const std::_Self*)((char*)&ei + offsetof(boost::detail::edge_iterator, boost::detail::adj_list_edge_iterator<boost::range_detail::integer_iterator<long unsigned int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::adjacency_list<boost::setS, boost::vecS, boost::directedS, clang_include_graph::include_graph_t::vertex_t, boost::no_property, boost::no_property, boost::listS> >::edges.boost::optional<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::<unnamed>.boost::optional_detail::optional_base<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::m_storage.boost::optional_detail::aligned_storage<std::pair<boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int>, boost::detail::out_edge_iter<std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >, long unsigned int, boost::detail::edge_desc_impl<boost::directed_tag, long unsigned int>, long int> > >::dummy_)).std::_Rb_tree_const_iterator<boost::detail::stored_edge_property<long unsigned int, boost::no_property> >::_M_node’ was declared here
2192 | edge_iterator ei, ei_end;
| ^~
I also tried boost 1.81, which resulted in additional warnings:
[ 21%] Building CXX object CMakeFiles/lib-clang-include-graph.dir/src/include_graph_parser.cc.o
/home/hamish/src/clang-include-graph/src/include_graph_parser.cc: In member function ‘void clang_include_graph::include_graph_parser_t::parse(clang_include_graph::include_graph_t&)’:
/home/hamish/src/clang-include-graph/src/include_graph_parser.cc:97:41: warning: ‘std::string boost::filesystem::extension(const path&)’ is deprecated: Use path::extension() instead [-Wdeprecated-declarations]
97 | if (boost::filesystem::extension(current_file).empty() ||
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
In file included from /usr/include/boost/filesystem.hpp:21,
from /home/hamish/src/clang-include-graph/src/util.h:22,
from /home/hamish/src/clang-include-graph/src/config.h:22,
from /home/hamish/src/clang-include-graph/src/include_graph_parser.h:22,
from /home/hamish/src/clang-include-graph/src/include_graph_parser.cc:19:
/usr/include/boost/filesystem/convenience.hpp:29:20: note: declared here
29 | inline std::string extension(const path& p)
| ^~~~~~~~~
/home/hamish/src/clang-include-graph/src/include_graph_parser.cc:98:41: warning: ‘std::string boost::filesystem::extension(const path&)’ is deprecated: Use path::extension() instead [-Wdeprecated-declarations]
98 | boost::filesystem::extension(current_file).find(".h") == 0) {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/usr/include/boost/filesystem/convenience.hpp:29:20: note: declared here
29 | inline std::string extension(const path& p)
| ^~~~~~~~~