mirror of https://github.com/CGAL/cgal
Quiet a warning [-Wmaybe-uninitialized]
```
[ 50%] Building CXX object CMakeFiles/test_exact_offset.dir/test_exact_offset.cpp.o
/usr/local/bin/c++ -DCGAL_TEST_SUITE=1 -DCGAL_USE_CORE=1 -DCGAL_USE_GMP -DCGAL_USE_MPFR -isystem /usr/include/x86_64-linux-gnu -I/home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-Release/test/Minkowski_sum_2 -I/home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-Release/include -I/mnt/testsuite/include -DDONT_USE_BOOST_PROGRAM_OPTIONS -Wall -Wextra -O3 -DCGAL_NDEBUG -frounding-math -Wall -frounding-math -o CMakeFiles/test_exact_offset.dir/test_exact_offset.cpp.o -c /home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-Release/test/Minkowski_sum_2/test_exact_offset.cpp
In file included from /mnt/testsuite/include/CGAL/Cartesian/Weighted_point_2.h:29,
from /mnt/testsuite/include/CGAL/Cartesian/Cartesian_base.h:34,
from /mnt/testsuite/include/CGAL/Cartesian.h:29,
from /home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-Release/test/Minkowski_sum_2/test_exact_offset.cpp:16:
/mnt/testsuite/include/CGAL/Handle_for.h: In function 'OutputIterator CGAL::partition_approx_convex_2(InputIterator, InputIterator, OutputIterator, const Traits&) [with InputIterator = __gnu_cxx::__normal_iterator<CGAL::Point_2<CGAL::Cartesian<CORE::BigRat> >*, std::vector<CGAL::Point_2<CGAL::Cartesian<CORE::BigRat> >, std::allocator<CGAL::Point_2<CGAL::Cartesian<CORE::BigRat> > > > >; Traits = CGAL::Partition_traits_2<Rat_kernel>; OutputIterator = std::back_insert_iterator<std::__cxx11::list<CGAL::Polygon_2<Rat_kernel, std::__cxx11::list<CGAL::Point_2<CGAL::Cartesian<CORE::BigRat> >, std::allocator<CGAL::Point_2<CGAL::Cartesian<CORE::BigRat> > > > >, std::allocator<CGAL::Polygon_2<Rat_kernel, std::__cxx11::list<CGAL::Point_2<CGAL::Cartesian<CORE::BigRat> >, std::allocator<CGAL::Point_2<CGAL::Cartesian<CORE::BigRat> > > > > > > >]':
/mnt/testsuite/include/CGAL/Handle_for.h:313:12: warning: '*((void*)& target +40)' may be used uninitialized in this function [-Wmaybe-uninitialized]
313 | return *(h.Ptr());
In file included from /mnt/testsuite/include/CGAL/partition_2.h:30,
from /mnt/testsuite/include/CGAL/Minkowski_sum_2/Decomposition_strategy_adapter.h:31,
from /mnt/testsuite/include/CGAL/Polygon_convex_decomposition_2.h:27,
from /home/cgal_tester/build/src/cmake/platforms/Ubuntu-latest-GCC6-Release/test/Minkowski_sum_2/test_exact_offset.cpp:22:
/mnt/testsuite/include/CGAL/Partition_2/partition_approx_convex_2.h:173:23: note: '*((void*)& target +40)' was declared here
173 | Circulator source, target, before_s, after_s;
| ^~~~~~
```
It seems sufficient to declare the variables at a smaller
scope. Strange...
This commit is contained in:
parent
6853a9202d
commit
896d5a7bd9
|
|
@ -170,7 +170,6 @@ OutputIterator partition_approx_convex_2(InputIterator first,
|
|||
} while (++c != first_c);
|
||||
|
||||
Segment_2 edge;
|
||||
Circulator source, target, before_s, after_s;
|
||||
|
||||
#ifdef CGAL_PARTITION_APPROX_CONVEX_DEBUG
|
||||
std::cout << "Inserting diagonals: " << std::endl;
|
||||
|
|
@ -207,10 +206,10 @@ OutputIterator partition_approx_convex_2(InputIterator first,
|
|||
if (!triangles.is_infinite(*e_circ))
|
||||
{
|
||||
edge = triangles.segment((*e_circ).first, (*e_circ).second);
|
||||
source = edge.source();
|
||||
target = edge.target();
|
||||
before_s = source; before_s--;
|
||||
after_s = source; after_s++;
|
||||
Circulator source = edge.source();
|
||||
Circulator target = edge.target();
|
||||
Circulator before_s = source; before_s--;
|
||||
Circulator after_s = source; after_s++;
|
||||
#ifdef CGAL_PARTITION_APPROX_CONVEX_DEBUG
|
||||
std::cout << "considering " << *source << " " << *target
|
||||
<< "...";
|
||||
|
|
|
|||
Loading…
Reference in New Issue