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

Using exact construction kernel with Release causes cc1plus: note: destination object is likely at address zero #8619

Open
AgarwalSaurav opened this issue Nov 21, 2024 · 0 comments

Comments

@AgarwalSaurav
Copy link

Issue Details

Compilation warning: cc1plus: note: destination object is likely at address zero
This is happening when setting CMAKE_BUILD_TYPE=Release and CGAL::Exact_predicates_exact_constructions_kernel.

Source Code

In the example code: CGAL-6.0.1/examples/Partition_2/y_monotone_partition_2.cpp, change the kernel to CGAL::Exact_predicates_exact_constructions_kernel.

#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Partition_traits_2.h>
#include <CGAL/partition_2.h>
#include <cassert>
#include <list>


typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef CGAL::Partition_traits_2<K>                         Traits;
typedef Traits::Point_2                                     Point_2;
typedef Traits::Polygon_2                                   Polygon_2;
typedef std::list<Polygon_2>                                Polygon_list;

void make_polygon(Polygon_2& polygon)
{
   polygon.push_back(Point_2(391, 374));
   polygon.push_back(Point_2(240, 431));
   polygon.push_back(Point_2(252, 340));
   polygon.push_back(Point_2(374, 320));
   polygon.push_back(Point_2(289, 214));
   polygon.push_back(Point_2(134, 390));
   polygon.push_back(Point_2( 68, 186));
   polygon.push_back(Point_2(154, 259));
   polygon.push_back(Point_2(161, 107));
   polygon.push_back(Point_2(435, 108));
   polygon.push_back(Point_2(208, 148));
   polygon.push_back(Point_2(295, 160));
   polygon.push_back(Point_2(421, 212));
   polygon.push_back(Point_2(441, 303));
}


int main( )
{
   Polygon_2    polygon;
   Polygon_list partition_polys;

   make_polygon(polygon);
   CGAL::y_monotone_partition_2(polygon.vertices_begin(),
                                polygon.vertices_end(),
                                std::back_inserter(partition_polys));

   std::list<Polygon_2>::const_iterator   poly_it;
   for (poly_it = partition_polys.begin(); poly_it != partition_polys.end();
        poly_it++)
   {
      assert(CGAL::is_y_monotone_2((*poly_it).vertices_begin(),
                                   (*poly_it).vertices_end()));
   }

   assert(CGAL::partition_is_valid_2(polygon.vertices_begin(),
                                     polygon.vertices_end(),
                                     partition_polys.begin(),
                                     partition_polys.end()));

   return 0;
}

Environment

  • Operating system: GNU/Linux x86_64
  • Compiler: gcc version 14.2.1 20240910 (GCC)
  • Release or debug mode: Release
  • Specific flags used (if any):
  • CGAL version: 6.0.1
  • Boost version: Boost-1.86.0
  • Other libraries versions if used (Eigen, TBB, etc.):
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