CGAL / cgal

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

Triangulation: Warning -Warray-bounds #6986

Open afabri opened 2 years ago

afabri commented 2 years ago

Issue Details

It would be good to understand where the warnings come from, to see if we have to fix something or suppress it.

/usr/include/eigen3/Eigen/src/Core/CoreEvaluators.h:207:52: warning: array subscript 35 is outside array bounds of ‘CGAL::CartesianDKernelFunctors::Contained_in_affine_hull<CGAL::Cartesian_base_d<leda::rational, CGAL::Dimension_tag<3>, CGAL::Default> >::Matrix [1]’ {aka ‘Eigen::Matrix<leda::rational, -1, -1, 0, 4, 4> [1]’} [-Warray-bounds]
  207 |       return m_d.data[row + col * m_d.outerStride()];
      |                                                    ^
In file included from /mnt/testsuite/include/CGAL/NewKernel_d/function_objects_cartesian.h:1287:

in the NewKernel_d and in the Triangulation testsuites.

Environment

See the platform

mglisse commented 2 years ago

This is a waste of time, all those recent optimization-based warnings in gcc are super fragile and chasing the myriad of false positives that they generate is not useful. I suggest disabling them globally for now. If you can get an error at runtime with some debug mode, then we can investigate.

lrineau commented 2 years ago

Those warnings are triggered by the code of determinant: https://github.com/CGAL/cgal/blob/fbcf90c5b75ac716e6423624f7a7b80ca4d326f2/NewKernel_d/include/CGAL/NewKernel_d/LA_eigen/LA.h#L114-L163

@mglisse: Do you want to disable -Warray-bound:

mglisse commented 2 years ago

I want to disable it (and -Wmaybe-uninitialized, etc) globally in gcc... (well at least move it from Wall to Wextra where it would do a bit less damage) I don't have a strong opinion what to do in cgal, as long as I don't have to deal with it personally. Your call.