Open
Description
Please use the following template to help us solving your issue.
Issue Details
stringop-overflow
compilation warning when compiling repair_polygon_soup.h
with mingw64/bin/c++.exe
.
FAILED: src/WAMlib/CMakeFiles/WAMlib.dir/mesh/mesh_extra.cpp.obj
ccache C:\ProgramData\scoop\apps\msys2\2024-07-27\mingw64\bin\c++.exe -DBOOST_CONTEXT_EXPORT="" -DBOOST_CONTEXT_NO_LIB="" -DBOOST_CONTEXT_STATIC_LINK="" -DBOOST_FIBER_NO_LIB -DBOOST_FIBER_STATIC_LINK -DCGAL_DISABLE_ROUNDING_MATH_CHECK=\"ON\" -DCGAL_EIGEN3_ENABLED -DCGAL_USE_GMPXX=1 -DENABLE_DATE_LIMIT -DENABLE_DEBUG_FEATURES -DENABLE_LICENSE_FEATURE -DEXPIRY_DATE=\"2025-03-01\" -DMINGW_HAS_SECURE_API=1 -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_OPENGL_LIB -DQT_QMLBUILTINS_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMODELS_LIB -DQT_QML_DEBUG -DQT_QML_LIB -DQT_QUICK3DRUNTIMERENDER_LIB -DQT_QUICK3DUTILS_LIB -DQT_QUICK3D_LIB -DQT_QUICKWIDGETS_LIB -DQT_QUICK_LIB -DQT_SHADERTOOLS_LIB -DQT_WIDGETS_LIB -DSPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE -DSPDLOG_COMPILED_LIB -DSPDLOG_FMT_EXTERNAL -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_GNU_SOURCE -D_UNICODE -D_WIN64 -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/src/WAMlib/WAMlib_autogen/include -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/src/WAMlib -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/geom/script -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/.. -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/../core -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/../core/include -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/common -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/primitives -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/geom -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/geometry -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/system -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/mesh -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/datastructure -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/transformer -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/guideliner -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/slicer -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/pathplanner -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/bead_processor -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/io -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/params -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/positioner -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/crates/target/cxxbridge -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/cargo/build/x86_64-pc-windows-gnu/cxxbridge -IC:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/include -isystem C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/vcpkg_installed/x64-mingw-static/include/eigen3 -isystem C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/vcpkg_installed/x64-mingw-static/include -isystem C:/Qt/6.7.2/mingw_64/include/QtCore -isystem C:/Qt/6.7.2/mingw_64/include -isystem C:/Qt/6.7.2/mingw_64/mkspecs/win32-g++ -isystem C:/Qt/6.7.2/mingw_64/include/QtWidgets -isystem C:/Qt/6.7.2/mingw_64/include/QtGui -isystem C:/Qt/6.7.2/mingw_64/include/QtQuick -isystem C:/Qt/6.7.2/mingw_64/include/QtQml -isystem C:/Qt/6.7.2/mingw_64/include/QtQmlIntegration -isystem C:/Qt/6.7.2/mingw_64/include/QtQmlBuiltins -isystem C:/Qt/6.7.2/mingw_64/include/QtNetwork -isystem C:/Qt/6.7.2/mingw_64/include/QtQmlModels -isystem C:/Qt/6.7.2/mingw_64/include/QtOpenGL -isystem C:/Qt/6.7.2/mingw_64/include/QtQuickWidgets -isystem C:/Qt/6.7.2/mingw_64/include/QtQuick3D -isystem C:/Qt/6.7.2/mingw_64/include/QtQuick3DRuntimeRender -isystem C:/Qt/6.7.2/mingw_64/include/QtQuick3DUtils -isystem C:/Qt/6.7.2/mingw_64/include/QtShaderTools -isystem C:/Qt/6.7.2/mingw_64/include/QtConcurrent -g -std=gnu++20 -g3 -ggdb3 -O3 -Wa,-mbig-obj -fvisibility=hidden -fvisibility-inlines-hidden -flarge-source-files -frounding-math -Werror -MD -MT src/WAMlib/CMakeFiles/WAMlib.dir/mesh/mesh_extra.cpp.obj -MF src\WAMlib\CMakeFiles\WAMlib.dir\mesh\mesh_extra.cpp.obj.d -o src/WAMlib/CMakeFiles/WAMlib.dir/mesh/mesh_extra.cpp.obj -c C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/mesh/mesh_extra.cpp
In file included from C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/algorithm:60,
from C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/vcpkg_installed/x64-mingw-static/include/CGAL/config.h:260,
from C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/vcpkg_installed/x64-mingw-static/include/CGAL/license/AABB_tree.h:17,
from C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/vcpkg_installed/x64-mingw-static/include/CGAL/AABB_face_graph_triangle_primitive.h:17,
from C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/primitives/cgal_adapt.h:3,
from C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/mesh/mesh_extra.h:3,
from C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/src/WAMlib/mesh/mesh_extra.cpp:1:
In static member function 'static constexpr _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = const long long unsigned int; _Up = long long unsigned int; bool _IsMove = false]',
inlined from 'constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = const long long unsigned int*; _OI = long long unsigned int*]' at C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_algobase.h:521:30,
inlined from 'constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = const long long unsigned int*; _OI = long long unsigned int*]' at C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_algobase.h:548:42,
inlined from 'constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = __gnu_cxx::__normal_iterator<const long long unsigned int*, vector<long long unsigned int> >; _OI = long long unsigned int*]' at C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_algobase.h:555:31,
inlined from 'constexpr _OI std::copy(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<const long long unsigned int*, vector<long long unsigned int> >; _OI = long long unsigned int*]' at C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_algobase.h:651:7,
inlined from 'static _ForwardIterator std::__uninitialized_copy<true>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const long long unsigned int*, std::vector<long long unsigned int> >; _ForwardIterator = long long unsigned int*]' at C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_uninitialized.h:147:27,
inlined from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const long long unsigned int*, vector<long long unsigned int> >; _ForwardIterator = long long unsigned int*]' at C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_uninitialized.h:185:15,
inlined from 'constexpr _ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const long long unsigned int*, vector<long long unsigned int> >; _ForwardIterator = long long unsigned int*; _Tp = long long unsigned int]' at C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_uninitialized.h:373:37,
inlined from 'constexpr std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = long long unsigned int; _Alloc = std::allocator<long long unsigned int>]' at C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_vector.h:606:31,
inlined from 'Polygon CGAL::Polygon_mesh_processing::internal::construct_canonical_polygon(const PointRange&, const Polygon&, bool&, const Traits&) [with Traits = CGAL::Epick; PointRange = std::vector<CGAL::Point_3<CGAL::Epick> >; Polygon = std::vector<long long unsigned int>]' at C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/vcpkg_installed/x64-mingw-static/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h:696:12,
inlined from 'DuplicateOutputIterator CGAL::Polygon_mesh_processing::internal::collect_duplicate_polygons(const PointRange&, const PolygonRange&, DuplicateOutputIterator, const Traits&, bool) [with PointRange = std::vector<CGAL::Point_3<CGAL::Epick> >; PolygonRange = std::vector<std::vector<long long unsigned int> >; DuplicateOutputIterator = std::back_insert_iterator<std::deque<std::vector<long long unsigned int>, std::allocator<std::vector<long long unsigned int> > > >; Traits = CGAL::Epick]' at C:/GitLab-Runner/builds/-P3pixj38/0/aml3d/monorepo/wamsoft/build/Debug/vcpkg_installed/x64-mingw-static/include/CGAL/Polygon_mesh_processing/repair_polygon_soup.h:867:44:
C:/ProgramData/scoop/apps/msys2/2024-07-27/mingw64/include/c++/14.1.0/bits/stl_algobase.h:452:30: error: 'void* __builtin_memmove(void*, const void*, long long unsigned int)' writing between 9 and 9223372036854775807 bytes into a region of size 8 overflows the destination [-Werror=stringop-overflow=]
452 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source Code
85 CGAL_Mesh repair_polygon_soup(const CGAL_Mesh& mesh) {
86 std::vector<K::Point_3> points;
87 std::vector<std::vector<std::size_t>> polygons;
88 CGAL_PMP::polygon_mesh_to_polygon_soup(mesh, points, polygons);
89
90 CGAL_PMP::repair_polygon_soup(points, polygons);
91 CGAL_PMP::orient_polygon_soup(points, polygons);
92
93 CGAL_Mesh repaired_mesh;
94 CGAL_PMP::polygon_soup_to_polygon_mesh(points, polygons, repaired_mesh);
95 return repaired_mesh;
96 }
Environment
- Operating system (Windows/Mac/Linux, 32/64 bits): Windows, 64 bits
- Compiler: mingw64\bin\c++.exe
- Release or debug mode: debug
- Specific flags used (if any):
- CGAL version: 6.0 (from vcpkg)
- Boost version:
- Other libraries versions if used (Eigen, TBB, etc.):