0

Trying to move an internal project to gcc 12.2 and boost 1.80.0. Getting maybe-uninitialized warning but it seems to be coming from inside boost, unsure how or if I can fix it. Would appreciate any help the community can provide.

13:03:40  In file included from /usr/local/include/c++/12.2.0/functional:59,
13:03:40                   from /docker-context/libs/boost-1.80.0/boost/numeric/conversion/converter_policies.hpp:13,
13:03:40                   from /docker-context/libs/boost-1.80.0/boost/numeric/conversion/converter.hpp:14,
13:03:40                   from /docker-context/libs/boost-1.80.0/boost/numeric/conversion/cast.hpp:33,
13:03:40                   from /docker-context/libs/boost-1.80.0/boost/lexical_cast/detail/converter_numeric.hpp:36,
13:03:40                   from /docker-context/libs/boost-1.80.0/boost/lexical_cast/try_lexical_convert.hpp:43,
13:03:40                   from /docker-context/libs/boost-1.80.0/boost/lexical_cast.hpp:32,
13:03:40                   from /workspace/workspace/<internal-project-path-0>.h:13,
13:03:40                   from /workspace/workspace/<internal-project-path-1>.h:9,
13:03:40                   from /workspace/workspace/<internal-project-path-2>.h:3,
13:03:40                   from /workspace/workspace/<internal-project-path-3>.cpp:1:
13:03:40  In constructor ‘std::function<_Res(_ArgTypes ...)>::function(std::function<_Res(_ArgTypes ...)>&&) [with _Res = bool; _ArgTypes = {char}]’,
13:03:40      inlined from ‘std::__detail::_State<_Char_type>::_State(std::__detail::_State<_Char_type>&&) [with _Char_type = char]’ at /usr/local/include/c++/12.2.0/bits/regex_automaton.h:149:4,
13:03:40      inlined from ‘std::__detail::_State<_Char_type>::_State(std::__detail::_State<_Char_type>&&) [with _Char_type = char]’ at /usr/local/include/c++/12.2.0/bits/regex_automaton.h:146:7,
13:03:40      inlined from ‘std::__detail::_StateIdT std::__detail::_NFA<_TraitsT>::_M_insert_subexpr_end() [with _TraitsT = std::__cxx11::regex_traits<char>]’ at /usr/local/include/c++/12.2.0/bits/regex_automaton.h:290:24:
13:03:40  /usr/local/include/c++/12.2.0/bits/std_function.h:405:42: error: ‘*(std::function<bool(char)>*)((char*)&__tmp + offsetof(std::__detail::_StateT, std::__detail::_State<char>::<unnamed>.std::__detail::_State_base::<unnamed>)).std::function<bool(char)>::_M_invoker’ may be used uninitialized [-Werror=maybe-uninitialized]
13:03:40    405 |       : _Function_base(), _M_invoker(__x._M_invoker)
13:03:40        |   
Jonathan
  • 552
  • 1
  • 4
  • 10
  • Take a look at the boost source code, find and fix the bug, submit a patch to boost - problem solved. – Jesper Juhl Oct 18 '22 at 13:43
  • For now I disabled the warning, so it is less of an issue compilation wise. But figured it won't hurt to ask the community. – Jonathan Oct 18 '22 at 18:20
  • By the way, after analyzing the error several times it is unclear to me from which library and usage the error originates from. Right now my best guess it is coming withing the standard library code, so not sure if the fix would be in boost code. – Jonathan Oct 19 '22 at 05:31

0 Answers0