Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tmva] Fix new warning in TMVA with gcc 13.2
When compiling with gcc 13.2, there is a new warning in TMVA that is fixed by this commit: ```c++ In static member function ‘static constexpr _Up* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(_Tp*, _Tp*, _Up*) [with _Tp = long unsigned int; _Up = long unsigned int; bool _IsMove = true]’, inlined from ‘constexpr _OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = true; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13.2.1/bits/stl_algobase.h:506:30, inlined from ‘constexpr _OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = true; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13.2.1/bits/stl_algobase.h:533:42, inlined from ‘constexpr _OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = true; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13.2.1/bits/stl_algobase.h:540:31, inlined from ‘constexpr _OI std::copy(_II, _II, _OI) [with _II = move_iterator<long unsigned int*>; _OI = long unsigned int*]’ at /usr/include/c++/13.2.1/bits/stl_algobase.h:633:7, inlined from ‘static _ForwardIterator std::__uninitialized_copy<true>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = std::move_iterator<long unsigned int*>; _ForwardIterator = long unsigned int*]’ at /usr/include/c++/13.2.1/bits/stl_uninitialized.h:147:27, inlined from ‘_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = move_iterator<long unsigned int*>; _ForwardIterator = long unsigned int*]’ at /usr/include/c++/13.2.1/bits/stl_uninitialized.h:185:15, inlined from ‘constexpr _ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, allocator<_Tp>&) [with _InputIterator = move_iterator<long unsigned int*>; _ForwardIterator = long unsigned int*; _Tp = long unsigned int]’ at /usr/include/c++/13.2.1/bits/stl_uninitialized.h:373:37, inlined from ‘constexpr _ForwardIterator std::__uninitialized_move_if_noexcept_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = long unsigned int*; _ForwardIterator = long unsigned int*; _Allocator = allocator<long unsigned int>]’ at /usr/include/c++/13.2.1/bits/stl_uninitialized.h:399:2, inlined from ‘constexpr void std::vector<_Tp, _Alloc>::_M_range_insert(iterator, _ForwardIterator, _ForwardIterator, std::forward_iterator_tag) [with _ForwardIterator = const long unsigned int*; _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>]’ at /usr/include/c++/13.2.1/bits/vector.tcc:819:9, inlined from ‘constexpr std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(const_iterator, std::initializer_list<_Tp>) [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>]’ at /usr/include/c++/13.2.1/bits/stl_vector.h:1411:17, inlined from ‘void TMVA::MethodDL::ParseInputLayout()’ at /home/rembserj/spaces/master/root/src/root/tmva/tmva/src/MethodDL.cxx:470:24: /usr/include/c++/13.2.1/bits/stl_algobase.h:437:30: error: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ forming offset 32 is out of the bounds [0, 32] [-Werror=array-bounds=] 437 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num); | ``` The fix suggested in this commit is to directly assign from a full initializer list, which is also more readable in the code.
- Loading branch information