Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/usr/include/xtl/xsequence.hpp:132:24: error: ‘ret’ may be used uninitialized #260

Open
drew-parsons opened this issue Sep 5, 2022 · 0 comments

Comments

@drew-parsons
Copy link

drew-parsons commented Sep 5, 2022

xsequence.hpp gives an error message

/usr/include/xtl/xsequence.hpp:132:24: error: ‘ret’ may be used uninitialized [-Werror=maybe-uninitialized]
  132 |                 return ret;
      |                        ^~~
/usr/include/xtl/xsequence.hpp: In static member function ‘static _Res std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes&& ...) [with _Res = xt::xtensor_container<xt::uvector<bool, std::allocator<bool> >, 1, xt::layout_type::row_major, xt::xtensor_expression_tag>; _Functor = dolfinx_wrappers::fem(pybind11::module&)::<lambda(const dolfinx::fem::FunctionSpace&, const std::function<pybind11::array_t<bool>(const pybind11::array_t<double, 16>&)>&)>::<lambda(xt::xtensor<double, 2>&)>; _ArgTypes = {const xt::xtensor_container<xt::uvector<double, std::allocator<double> >, 2, xt::layout_type::row_major, xt::xtensor_expression_tag>&}]’:
/usr/include/xtl/xsequence.hpp:130:19: note: ‘ret’ declared here
  130 |                 R ret;
      |                   ^~~

It's currently preventing the debian build of dolfinx on mip64el, build log here. In this context it's treated as an error (-Werror=maybe-uninitialized) causing the build to fail. (I haven't understood why it's only affecting mips64el and not other architectures. The other dolfinx builds are found at https://buildd.debian.org/status/package.php?p=fenics-dolfinx )

The error also shows up in xtensor 0.7.4 CI testing on the conventional amd64 architecture, e.g https://ci.debian.net/data/autopkgtest/testing/amd64/x/xtensor/25056327/log.gz In this context it's treated as a warning (-Wmaybe-uninitialized) not an error, so the tests pass. But the warning is still there.

Are code changes possible to prevent this warning from being emitted?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant