diff --git a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h index 3acb28c4290..63bc9917dfd 100644 --- a/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h +++ b/Envelope_2/include/CGAL/Envelope_2/Env_divide_and_conquer_2_impl.h @@ -627,8 +627,9 @@ _merge_two_intervals(Edge_const_handle e1, bool is_leftmost1, // This is the rightmost vertex in the current minimization diagram (out_d). // The intersection points/curves that interest us are the ones in // [v_leftmost, v]. + // Without using make_optional we get a "maybe uninitialized" warning with gcc -Wall boost::optional v_leftmost = - boost::optional(); + boost::make_optional(false, Vertex_const_handle()); if (is_leftmost1 == true) { if (is_leftmost2 == false) diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/Compare_squared_radius_3.h b/Filtered_kernel/include/CGAL/internal/Static_filters/Compare_squared_radius_3.h index 22b604213ca..d833cdcdc7d 100644 --- a/Filtered_kernel/include/CGAL/internal/Static_filters/Compare_squared_radius_3.h +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/Compare_squared_radius_3.h @@ -65,6 +65,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { // but Lazy ones. double px, py, pz, qx, qy, qz, rx, ry, rz, sx, sy, sz, alpha; + init_double(px, py, pz, qx, qy, qz, rx, ry, rz, sx, sy, sz, alpha, (FT*)(0)); if( fit_in_double(get_approx(p).x(), px) && fit_in_double(get_approx(p).y(), py) && fit_in_double(get_approx(p).z(), pz) && @@ -216,6 +217,8 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Compare_squared_radius_3 with 3 points", tmp); double px, py, pz, qx, qy, qz, sx, sy, sz, alpha; + init_double(px, py, pz, qx, qy, qz, sx, sy, sz, alpha, (FT*)(0)); + if( fit_in_double(p.x(), px) && fit_in_double(p.y(), py) && fit_in_double(p.z(), pz) && fit_in_double(q.x(), qx) && fit_in_double(q.y(), qy) && @@ -347,6 +350,7 @@ namespace CGAL { namespace internal { namespace Static_filters_predicates { CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Compare_squared_radius_3 with 2 points", tmp); double px, py, pz, qx, qy, qz, alpha; + init_double(px, py, pz, qx, qy, qz, alpha, (FT*)(0)); if( fit_in_double(p.x(), px) && fit_in_double(p.y(), py) && fit_in_double(p.z(), pz) && fit_in_double(q.x(), qx) && fit_in_double(q.y(), qy) && diff --git a/Filtered_kernel/include/CGAL/internal/Static_filters/tools.h b/Filtered_kernel/include/CGAL/internal/Static_filters/tools.h index 5b249bea9c8..25561776008 100644 --- a/Filtered_kernel/include/CGAL/internal/Static_filters/tools.h +++ b/Filtered_kernel/include/CGAL/internal/Static_filters/tools.h @@ -39,6 +39,103 @@ inline bool diff_was_exact(double a, double b, double ab) return ab+b == a && a-ab == b; } +template < typename T > +inline void init_double(double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, double&, double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, double&, double&, double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, double&, double&, double&, double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, double&, double&, double&, double&, double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, double&, double&, double&, double&, double&, double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, double&,double&, double&, double&, double&, double&, double&, T* ) {} + +template < typename T > +inline void init_double(double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, T* ) {} + + +template < typename T > +inline void init_double(double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, T* ) {} + + +template < typename T > +inline void init_double(double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, T* ) {} + + +template < typename T > +inline void init_double(double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, double&, T* ) {} + + + +template < typename ET > +inline void init_double(double& d0, Lazy_exact_nt* ) +{d0 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, Lazy_exact_nt* ) +{d0 = d1 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, Lazy_exact_nt* ) +{d0 = d1 = d2 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = d5 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = d5 = d6 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double& d8, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, double& d11, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = d11 = 0;} + +template < typename ET > +inline void init_double(double& d0, double& d1, double& d2, double& d3, double& d4, double& d5, double& d6, double& d7, double&d8, double& d9, double& d10, double& d11, double& d12, Lazy_exact_nt* ) +{d0 = d1 = d2 = d3 = d4 = d5 = d6 = d7 = d8 = d9 = d10 = d11 = d12 = 0;} + + // Auxiliary function to check if static filters can be applied, that is, // if to_double() does not add roundoff errors. // TODO : diff --git a/Surface_mesher/test/Surface_mesher/test_c2t3_iterators.cpp b/Surface_mesher/test/Surface_mesher/test_c2t3_iterators.cpp index b244915b538..6f4ee639dba 100644 --- a/Surface_mesher/test/Surface_mesher/test_c2t3_iterators.cpp +++ b/Surface_mesher/test/Surface_mesher/test_c2t3_iterators.cpp @@ -31,7 +31,7 @@ int main(int , char**) for(int i = 0; i < 2; ++i) { Tr::Cell_handle cell; - int i1, i2, i3; + int i1=0, i2=0, i3=0; // initialize to avoid a g++ -Wall warning tr.is_facet(v[i+1], v[(i+2)&3], v[(i+3)&3], cell, i1, i2, i3);