iceoryx icon indicating copy to clipboard operation
iceoryx copied to clipboard

iox-#2011 Silence some warnings when building with GCC 13.

Open clalancette opened this issue 1 month ago • 1 comments

GCC 13 (which is in Ubuntu 24.04) introduced a number of false positive warnings when using -Warray-bounds and -Wstring-op; see:

  • https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114758
  • https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111118
  • https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110807
  • https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110498

In my testing, these only show up when building with optimizations, i.e. CMAKE_BUILD_TYPE=RelWithDebInfo.

This commit silences those warnings across the two functions that cause the problem, and make the build completely clean.

Notes for Reviewer

This should fix the yellow builds in e.g. https://ci.ros2.org/view/packaging/job/packaging_linux/3451/ Note that this targets the release_2.0 branch, since that is what ROS 2 is currently using. If you'd like me to target another branch and then backport, I'm happy to do that instead.

Pre-Review Checklist for the PR Author

  1. [x] Code follows the coding style of CONTRIBUTING.md
  2. [N/A] Tests follow the best practice for testing
  3. [x] Changelog updated in the unreleased section including API breaking changes
  4. [N/A] Branch follows the naming format (iox-123-this-is-a-branch)
  5. [x] Commits messages are according to this guideline
  6. [x] Update the PR title
    • Follow the same conventions as for commit messages
    • Link to the relevant issue
  7. [N/A] Relevant issues are linked
  8. [x] Add sensible notes for the reviewer
  9. [ ] All checks have passed (except task-list-completed)
  10. [ ] Assign PR to reviewer

Checklist for the PR Reviewer

  • [ ] Consider a second reviewer for complex new features or larger refactorings
  • [ ] Commits are properly organized and messages are according to the guideline
  • [ ] Code according to our coding style and naming conventions
  • [ ] Unit tests have been written for new behavior
  • [ ] Public API changes are documented via doxygen
  • [ ] Copyright owner are updated in the changed files
  • [ ] All touched (C/C++) source code files from iceoryx_hoofs have been added to ./clang-tidy-diff-scans.txt
  • [ ] PR title describes the changes

Post-review Checklist for the PR Author

  1. [ ] All open points are addressed and tracked via issues

References

  • Closes TBD

clalancette avatar May 24 '24 15:05 clalancette