-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
memset for Eigen::Matrix in integral_image2D.cpp #3368
Comments
Could you please post the warning you are talking about? |
In file included from ../features/include/pcl/features/integral_image2D.h:346,
from ../features/include/pcl/features/integral_image_normal.h:45,
from ../features/include/pcl/features/impl/integral_image_normal.hpp:42,
from ../features/src/integral_image_normal.cpp:39:
../features/include/pcl/features/impl/integral_image2D.hpp: In instantiation of ‘void
pcl::IntegralImage2D<DataType, Dimension>::computeIntegralImages(const DataType*,
unsigned int, unsigned int) [with DataType = float; unsigned int Dimension = 3]’:
../features/include/pcl/features/impl/integral_image2D.hpp:65:3: required from ‘void
pcl::IntegralImage2D<DataType, Dimension>::setInput(const DataType*, unsigned int,
unsigned int, unsigned int, unsigned int) [with DataType = float; unsigned int Dimension
= 3]’
../features/include/pcl/features/impl/integral_image_normal.hpp:133:23: required from
‘void pcl::IntegralImageNormalEstimation<PointInT, PointOutT>::initCovarianceMatrixMethod()
[with PointInT = pcl::PointXYZ; PointOutT = pcl::Normal]’
../features/src/integral_image_normal.cpp:48:3: required from here
../features/include/pcl/features/impl/integral_image2D.hpp:159:10: warning: ‘void*
memset(void*, int, size_t)’ clearing an object of type ‘using ElementType = class
Eigen::Matrix<double, 3, 1>’ {aka ‘class Eigen::Matrix<double, 3, 1>’} with no trivial
copy-assignment; use assignment or value-initialization instead [-Wclass-memaccess]
159 | memset (previous_row, 0, sizeof (ElementType) * (width_ + 1));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/eigen3/Eigen/Core:458,
from ../common/include/pcl/pcl_macros.h:73,
from ../features/include/pcl/features/integral_image_normal.h:41,
from ../features/include/pcl/features/impl/integral_image_normal.hpp:42,
from ../features/src/integral_image_normal.cpp:39:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:178:7: note: ‘using ElementType = class
Eigen::Matrix<double, 3, 1>’ {aka ‘class Eigen::Matrix<double, 3, 1>’} declared here
178 | class Matrix
| ^~~~~~
In file included from ../features/include/pcl/features/integral_image2D.h:346,
from ../features/include/pcl/features/integral_image_normal.h:45,
from ../features/include/pcl/features/impl/integral_image_normal.hpp:42,
from ../features/src/integral_image_normal.cpp:39:
../features/include/pcl/features/impl/integral_image2D.hpp:190:12: warning: ‘void*
memset(void*, int, size_t)’ clearing an object of type ‘using SecondOrderType = class
Eigen::Matrix<double, 6, 1, 0, 6, 1>’ {aka ‘class Eigen::Matrix<double, 6, 1, 0, 6, 1>’} with
no trivial copy-assignment; use assignment or value-initialization instead
[-Wclass-memaccess]
190 | memset (so_previous_row, 0, sizeof (SecondOrderType) * (width_ + 1));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/eigen3/Eigen/Core:458,
from ../common/include/pcl/pcl_macros.h:73,
from ../features/include/pcl/features/integral_image_normal.h:41,
from ../features/include/pcl/features/impl/integral_image_normal.hpp:42,
from ../features/src/integral_image_normal.cpp:39:
/usr/include/eigen3/Eigen/src/Core/Matrix.h:178:7: note: ‘using SecondOrderType =
class Eigen::Matrix<double, 6, 1, 0, 6, 1>’ {aka ‘class Eigen::Matrix<double, 6, 1, 0, 6, 1>’}
declared here
178 | class Matrix
| ^~~~~~ |
I don't see a way out of this without at least minor refactoring of the code.
|
Marking this as stale due to 30 days of inactivity. It will be closed in 7 days if no further activity occurs. |
In
If I replace the
which means that Why does the compiler think that =====
=====
passes as well. |
Yeah, I have been meaning to change it to use |
Are you targeting C++17 support in 1.12? |
No. Maybe template specialization can help (or we can add a function to abstract the issue) |
Lines 159, 190 in file
features/include/pcl/features/impl/integral_image2D.hpp
:pcl/features/include/pcl/features/impl/integral_image2D.hpp
Line 159 in 8ab5ae4
pcl/features/include/pcl/features/impl/integral_image2D.hpp
Line 190 in 8ab5ae4
memset
is being called uponElementType
andSecondOrderType
which are template parameter. As such I don't see a way out of the warning, unless we are guaranteed that types havedata
field if it has no trivial copy-assignmentThe text was updated successfully, but these errors were encountered: