geometric_shapes icon indicating copy to clipboard operation
geometric_shapes copied to clipboard

bodies.cpp: Variable may be used uninitialized

Open AndyZe opened this issue 2 years ago • 0 comments

I just noticed this warning while building (ros2 branch):

--- stderr: geometric_shapes
In file included from /usr/include/eigen3/Eigen/Core:294,
                 from /usr/include/eigen3/Eigen/Geometry:11,
                 from /workspaces/ws_miso/src/geometric_shapes/include/geometric_shapes/aabb.h:34,
                 from /workspaces/ws_miso/src/geometric_shapes/include/geometric_shapes/bodies.h:35,
                 from /workspaces/ws_miso/src/geometric_shapes/src/bodies.cpp:31:
In member function ‘Eigen::PlainObjectBase<Derived>& Eigen::PlainObjectBase<Derived>::operator=(Eigen::PlainObjectBase<Derived>&&) [with Derived = Eigen::Matrix<double, 3, 1>]’,
    inlined from ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::operator=(Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>&&) [with _Scalar = double; int _Rows = 3; int _Cols = 1; int _Options = 0; int _MaxRows = 3; int _MaxCols = 1]’ at /usr/include/eigen3/Eigen/src/Core/Matrix.h:281:22,
    inlined from ‘virtual void bodies::ConvexMesh::useDimensions(const shapes::Shape*)’ at /workspaces/ws_miso/src/geometric_shapes/src/bodies.cpp:852:46:
/usr/include/eigen3/Eigen/src/Core/PlainObjectBase.h:504:7: warning: ‘*(Eigen::DenseStorage<double, 3, 3, 1, 0>*)((char*)&<unnamed> + offsetof(Eigen::Vector3d, Eigen::Matrix<double, 3, 1, 0, 3, 1>::<unnamed>.Eigen::PlainObjectBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >::<unnamed>.Eigen::MatrixBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >::<unnamed>.Eigen::DenseBase<Eigen::Matrix<double, 3, 1, 0, 3, 1> >::<unnamed>.Eigen::DenseCoeffsBase<Eigen::Matrix<double, 3, 1, 0, 3, 1>, 3>::<unnamed>.Eigen::DenseCoeffsBase<Eigen::Matrix<double, 3, 1, 0, 3, 1>, 1>::<unnamed>.Eigen::DenseCoeffsBase<Eigen::Matrix<double, 3, 1, 0, 3, 1>, 0>::<unnamed>))’ may be used uninitialized [-Wmaybe-uninitialized]
  504 |       m_storage = std::move(other.m_storage);

AndyZe avatar May 01 '22 21:05 AndyZe