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

Compatibility with clang-19 #6113

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

mvieth
Copy link
Member

@mvieth mvieth commented Aug 22, 2024

Fix errors reported by the upcoming clang 19. It seems like clang 19 checks these functions, even though they are not actually compiled/used anywhere (otherwise the other compilers would have complained already).
Regarding the changes in poisson4: I did my best to put something plausible there, but I am not very familiar with that code, so it might not be the best solution. But since those function are seemingly not used anywhere, it should not matter that much.

Here are the errors reported by clang 19:

In file included from /pcl/surface/src/poisson.cpp:40:
In file included from /pcl/surface/include/pcl/surface/impl/poisson.hpp:48:
In file included from /pcl/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.h:283:
/pcl/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp:749:41: error: no member named 'center' in 'OctNode<NodeData, Real>'
  749 |         temp=SquareDistance(children[i].center,p);
      |                             ~~~~~~~~~~~ ^
/pcl/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp:810:38: error: no member named 'offset' in 'OctNode<NodeData, Real>'
  810 |       for(i=0;i<DIMENSION;i++){this->offset[i] = node.offset[i];}
      |                                ~~~~  ^
/pcl/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp:820:51: error: reference to non-static member function must be called
  820 |       return ((const OctNode<NodeData,Real>*)v1)->depth-((const OctNode<NodeData,Real>*)v2)->depth;
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
/pcl/surface/include/pcl/surface/3rdparty/poisson4/octree_poisson.hpp:877:51: error: reference to non-static member function must be called
  877 |       return ((const OctNode<NodeData,Real>*)v2)->depth-((const OctNode<NodeData,Real>*)v1)->depth;
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
In file included from /pcl/surface/src/poisson.cpp:40:
In file included from /pcl/surface/include/pcl/surface/impl/poisson.hpp:49:
In file included from /pcl/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.h:185:
/pcl/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp:231:20: error: no member named 'm_N' in 'SparseMatrix<T>'
  231 |       Resize(this->m_N, this->m_M);
      |              ~~~~  ^
/pcl/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp:231:31: error: no member named 'm_M' in 'SparseMatrix<T>'
  231 |       Resize(this->m_N, this->m_M);
      |                         ~~~~  ^
/pcl/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp:238:51: error: no member named 'Columns' in 'SparseMatrix<T>'
  238 |       for(int ij=0; ij < Min( this->Rows(), this->Columns() ); ij++)
      |                                             ~~~~  ^
/pcl/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp:238:37: error: no member named 'Rows' in 'SparseMatrix<T>'
  238 |       for(int ij=0; ij < Min( this->Rows(), this->Columns() ); ij++)
      |                               ~~~~  ^
/pcl/surface/include/pcl/surface/3rdparty/poisson4/sparse_matrix.hpp:391:25: error: no member named 'Columns' in 'SparseMatrix<T>'
  391 |       solution.Resize(M.Columns());
      |                       ~ ^
[ 23%] Linking CXX executable ../../bin/pcl_example_extract_indices
9 errors generated.
gmake[2]: *** [surface/CMakeFiles/pcl_surface.dir/build.make:328: surface/CMakeFiles/pcl_surface.dir/src/poisson.cpp.o] Error 1
In file included from /pcl/registration/src/correspondence_rejection_features.cpp:40:
/pcl/registration/include/pcl/registration/correspondence_rejection_features.h:274:25: error: no member named 'getClassName' in 'FeatureContainer<FeatureT>'
  274 |                   this->getClassName().c_str());
      |                   ~~~~  ^
/pcl/common/include/pcl/console/print.h:60:70: note: expanded from macro 'PCL_ERROR'
   60 | #define PCL_ERROR(...)   pcl::console::print (pcl::console::L_ERROR, __VA_ARGS__)
      |                                                                      ^~~~~~~~~~~
1 error generated.
gmake[2]: *** [registration/CMakeFiles/pcl_registration.dir/build.make:188: registration/CMakeFiles/pcl_registration.dir/src/correspondence_rejection_features.cpp.o] Error 1

@mvieth mvieth added the changelog: enhancement Meta-information for changelog generation label Aug 23, 2024
@mvieth mvieth marked this pull request as ready for review August 23, 2024 08:44
@larshg
Copy link
Contributor

larshg commented Aug 26, 2024

Looks reasonable 😄

@mvieth mvieth merged commit 6f1105a into PointCloudLibrary:master Aug 26, 2024
13 checks passed
@mvieth mvieth deleted the clang19_compatibility branch August 26, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: enhancement Meta-information for changelog generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants