CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.98k stars 1.39k forks source link

Compilation error in remesh_impl.h when CGAL_NO_ASSERTIONS is defined #7055

Closed jwfallawuiuc closed 1 year ago

jwfallawuiuc commented 1 year ago

Issue Details

Compilation error when CGAL_NO_ASSERTIONS is defined, but CGAL_NO_WARNINGS is not:

In file included from /build/vcpkg_installed/x64-linux/include/CGAL/basic.h:26,
                 from /build/vcpkg_installed/x64-linux/include/CGAL/Cartesian/Cartesian_base.h:20,
                 from /build/vcpkg_installed/x64-linux/include/CGAL/Simple_cartesian.h:20,
                 from {our code}
/build/vcpkg_installed/x64-linux/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h: In constructor 'CGAL::Polygon_mesh_processing::internal::Incremental_remesher<PolygonMesh, VertexPointMap, GeomTraits, EdgeIsConstrainedMap, VertexIsConstrainedMap, FacePatchMap, FaceIndexMap>::Incremental_remesher(PolygonMesh&, VertexPointMap&, const GeomTraits&, bool, EdgeIsConstrainedMap, VertexIsConstrainedMap, FacePatchMap, FaceIndexMap, bool)':
/build/vcpkg_installed/x64-linux/include/CGAL/Polygon_mesh_processing/internal/Isotropic_remeshing/remesh_impl.h:326:7: error: 'input_mesh_is_valid_' was not declared in this scope
  326 |       CGAL_warning_msg(input_mesh_is_valid_,
      |       ^~~~~~~~~~~~~~~~

I believe the problem is that in remesh_impl.h, line 326 references the variable 'input_mesh_isvalid' which is defined on line 325, but if CGAL_NO_ASSERTIONS defined, then the macro on line 325 no longer defines the variable and the reference on line 326 results in an error.

Source Code

#include <CGAL/Polygon_mesh_processing/remesh.h>

int
main(int _argc, char** _argv) {

  return 0;
}

Environment

janetournois commented 1 year ago

Hello @jwfallawuiuc thank you for the report, I will give it a try