/in/foo.cc: In function 'int search(int, std::vector<int>)':
/in/foo.cc:7:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
7 | for (int i = 0; i < a.size(); i++)
| ~~^~~~~~~~~~
/in/foo.cc: In function 'int main()':
/in/foo.cc:26:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
26 | for (int i = 0; i < va.size(); i++)
| ~~^~~~~~~~~~~
In file included from /usr/include/c++/12/string:50,
from /usr/include/c++/12/bits/locale_classes.h:40,
from /usr/include/c++/12/bits/ios_base.h:41,
from /usr/include/c++/12/ios:42,
from /usr/include/c++/12/ostream:38,
from /usr/include/c++/12/iostream:39,
from /in/foo.cc:1:
In static member function 'static _Tp* std::__copy_move<_IsMove, true, std::random_access_iterator_tag>::__copy_m(const _Tp*, const _Tp*, _Tp*) [with _Tp = int; bool _IsMove = true]',
inlined from '_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = true; _II = int*; _OI = int*]' at /usr/include/c++/12/bits/stl_algobase.h:495:30,
inlined from '_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = true; _II = int*; _OI = int*]' at /usr/include/c++/12/bits/stl_algobase.h:522:42,
inlined from '_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = true; _II = __gnu_cxx::__normal_iterator<int*, vector<int> >; _OI = __gnu_cxx::__normal_iterator<int*, vector<int> >]' at /usr/include/c++/12/bits/stl_algobase.h:529:31,
inlined from '_OI std::move(_II, _II, _OI) [with _II = __gnu_cxx::__normal_iterator<int*, vector<int> >; _OI = __gnu_cxx::__normal_iterator<int*, vector<int> >]' at /usr/include/c++/12/bits/stl_algobase.h:652:38,
inlined from 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::_M_erase(iterator) [with _Tp = int; _Alloc = std::allocator<int>]' at /usr/include/c++/12/bits/vector.tcc:179:2,
inlined from 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(const_iterator) [with _Tp = int; _Alloc = std::allocator<int>]' at /usr/include/c++/12/bits/stl_vector.h:1530:24,
inlined from 'int main()' at /in/foo.cc:24:12:
/usr/include/c++/12/bits/stl_algobase.h:431:30: warning: 'void* __builtin_memmove(void*, const void*, long unsigned int)' writing 1 or more bytes into a region of size 0 overflows the destination [-Wstringop-overflow=]
431 | __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
| ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/12/bits/c++allocator.h:33,
from /usr/include/c++/12/bits/allocator.h:46,
from /usr/include/c++/12/string:41:
In member function '_Tp* std::__new_allocator<_Tp>::allocate(size_type, const void*) [with _Tp = int]',
inlined from 'static _Tp* std::allocator_traits<std::allocator<_CharT> >::allocate(allocator_type&, size_type) [with _Tp = int]' at /usr/include/c++/12/bits/alloc_traits.h:464:28,
inlined from 'std::_Vector_base<_Tp, _Alloc>::pointer std::_Vector_base<_Tp, _Alloc>::_M_allocate(std::size_t) [with _Tp = int; _Alloc = std::allocator<int>]' at /usr/include/c++/12/bits/stl_vector.h:378:33,
inlined from 'void std::_Vector_base<_Tp, _Alloc>::_M_create_storage(std::size_t) [with _Tp = int; _Alloc = std::allocator<int>]' at /usr/include/c++/12/bits/stl_vector.h:395:44,
inlined from 'std::_Vector_base<_Tp, _Alloc>::_Vector_base(std::size_t, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>]' at /usr/include/c++/12/bits/stl_vector.h:332:26,
inlined from 'std::vector<_Tp, _Alloc>::vector(size_type, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>]' at /usr/include/c++/12/bits/stl_vector.h:552:47,
inlined from 'int main()' at /in/foo.cc:15:20:
/usr/include/c++/12/bits/new_allocator.h:137:55: note: at offset -4 into destination object of size [4, 8589934588] allocated by 'operator new'
137 | return static_cast<_Tp*>(_GLIBCXX_OPERATOR_NEW(__n * sizeof(_Tp)));
| ^