Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence one more gcc false-positive. #814

Merged
merged 1 commit into from
Jun 21, 2024
Merged

Conversation

clalancette
Copy link
Contributor

gcc 13 has false positives around array-bounds and stringop-overflow, so suppress them here while generating test cases.

@Crola1702 FYI, this should fix #813

gcc 13 has false positives around array-bounds and
stringop-overflow, so suppress them here while generating
test cases.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like fine changes for a test file.

#813 seems to have the -Warray-bounds warning. What does the -Wstringop-overflow warning look like?

@clalancette
Copy link
Contributor Author

#813 seems to have the -Warray-bounds warning. What does the -Wstringop-overflow warning look like?

Yeah, good question. Sometimes we get one, and sometimes we get both. In this case, the stringop warning is similar and looks like:

In static member function ‘static _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 = false]’,
    inlined from ‘_OI std::__copy_move_a2(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:506:30,
    inlined from ‘_OI std::__copy_move_a1(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:533:42,
    inlined from ‘_OI std::__copy_move_a(_II, _II, _OI) [with bool _IsMove = false; _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:540:31,
    inlined from ‘_OI std::copy(_II, _II, _OI) [with _II = long unsigned int*; _OI = long unsigned int*]’ at /usr/include/c++/13/bits/stl_algobase.h:633:7,
    inlined from ‘std::vector<bool, _Alloc>::iterator std::vector<bool, _Alloc>::_M_copy_aligned(const_iterator, const_iterator, iterator) [with _Alloc = std::allocator<bool>]’ at /usr/include/c++/13/bits/stl_bvector.h:1342:28,
    inlined from ‘void std::vector<bool, _Alloc>::_M_fill_insert(iterator, size_type, bool) [with _Alloc = std::allocator<bool>]’ at /usr/include/c++/13/bits/vector.tcc:879:34,
    inlined from ‘std::vector<bool, _Alloc>::iterator std::vector<bool, _Alloc>::insert(const_iterator, size_type, const bool&) [with _Alloc = std::allocator<bool>]’ at /usr/include/c++/13/bits/stl_bvector.h:1242:16,
    inlined from ‘void std::vector<bool, _Alloc>::resize(size_type, bool) [with _Alloc = std::allocator<bool>]’ at /usr/include/c++/13/bits/stl_bvector.h:1288:10:
/usr/include/c++/13/bits/stl_algobase.h:437:30: warning: ‘void* __builtin_memmove(void*, const void*, long unsigned int)’ writing between 9 and 9223372036854775807 bytes into a region of size 8 overflows the destination [-Wstringop-overflow=]
  437 |             __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
      |             ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@clalancette
Copy link
Contributor Author

clalancette commented Jun 21, 2024

CI:

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status
  • Linux Release Build Status

@clalancette clalancette merged commit 86fa398 into rolling Jun 21, 2024
4 checks passed
@clalancette clalancette deleted the clalancette/gcc-warning branch June 21, 2024 20:27
Crola1702 pushed a commit that referenced this pull request Jun 26, 2024
gcc 13 has false positives around array-bounds and
stringop-overflow, so suppress them here while generating
test cases.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@Crola1702
Copy link

https://github.com/Mergifyio backport jazzy

Copy link
Contributor

mergify bot commented Jul 1, 2024

backport jazzy

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jul 1, 2024
gcc 13 has false positives around array-bounds and
stringop-overflow, so suppress them here while generating
test cases.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit 86fa398)
ahcorde pushed a commit that referenced this pull request Jul 1, 2024
gcc 13 has false positives around array-bounds and
stringop-overflow, so suppress them here while generating
test cases.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
(cherry picked from commit 86fa398)

Co-authored-by: Chris Lalancette <clalancette@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🧑‍🌾 Release builds rosidl_generator_cpp stl_algobase.h warning on Ubuntu
3 participants