eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.69k stars 396 forks source link

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

Closed clalancette closed 5 months ago

clalancette commented 6 months ago

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

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. [x] All checks have passed (except task-list-completed)
  10. [x] Assign PR to reviewer

Checklist for the PR Reviewer

Post-review Checklist for the PR Author

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

References

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.49%. Comparing base (34d9d53) to head (434ee45). Report is 1 commits behind head on release_2.0.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296/graphs/tree.svg?width=650&height=150&src=pr&token=KWu8wdCc1S&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx)](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx) ```diff @@ Coverage Diff @@ ## release_2.0 #2296 +/- ## =============================================== + Coverage 78.46% 78.49% +0.02% =============================================== Files 370 370 Lines 14217 14217 Branches 2060 2060 =============================================== + Hits 11156 11160 +4 + Misses 2377 2372 -5 - Partials 684 685 +1 ``` | [Flag](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx) | `77.71% <ø> (+0.01%)` | :arrow_up: | | [unittests_timing](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx) | `15.15% <ø> (+0.02%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx) | Coverage Δ | | |---|---|---| | [...clude/iceoryx\_hoofs/internal/cxx/variant\_queue.inl](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296?src=pr&el=tree&filepath=iceoryx_hoofs%2Finclude%2Ficeoryx_hoofs%2Finternal%2Fcxx%2Fvariant_queue.inl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx#diff-aWNlb3J5eF9ob29mcy9pbmNsdWRlL2ljZW9yeXhfaG9vZnMvaW50ZXJuYWwvY3h4L3ZhcmlhbnRfcXVldWUuaW5s) | `78.31% <ø> (ø)` | | | [...nternal/popo/building\_blocks/chunk\_distributor.inl](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296?src=pr&el=tree&filepath=iceoryx_posh%2Finclude%2Ficeoryx_posh%2Finternal%2Fpopo%2Fbuilding_blocks%2Fchunk_distributor.inl&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx#diff-aWNlb3J5eF9wb3NoL2luY2x1ZGUvaWNlb3J5eF9wb3NoL2ludGVybmFsL3BvcG8vYnVpbGRpbmdfYmxvY2tzL2NodW5rX2Rpc3RyaWJ1dG9yLmlubA==) | `96.06% <ø> (ø)` | | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/eclipse-iceoryx/iceoryx/pull/2296/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=eclipse-iceoryx)
elBoberido commented 6 months ago

@clalancette we need to release v3.0 soonish. All of this is already fixed on the main branch.

The clang-tidy check might also bite us here. We might need to ignore it for this branch since the code was not yet fixed and it seems we also did not make it run with all files. Can you add #include "iceoryx_hoofs/cxx/variant.hpp" at the top of variant.inl? If clang-tidy continue to fail, we will just ignore it for this PR.

elBoberido commented 6 months ago

@clalancette oh, you already noticed to use #2011 as reference issue. Please adjust your commit message accordingly.

clalancette commented 6 months ago

Can you add #include "iceoryx_hoofs/cxx/variant.hpp" at the top of variant.inl?

It looks like it is already there on the release_2.0 branch: https://github.com/eclipse-iceoryx/iceoryx/blob/release_2.0/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant.inl#L21

@clalancette oh, you already noticed to use #2011 as reference issue. Please adjust your commit message accordingly.

My commit message already has "iox-#2011" as the first line of the commit message, but let me know if I need to change it to something else.

elBoberido commented 5 months ago

Can you add #include "iceoryx_hoofs/cxx/variant.hpp" at the top of variant.inl?

It looks like it is already there on the release_2.0 branch: https://github.com/eclipse-iceoryx/iceoryx/blob/release_2.0/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant.inl#L21

@clalancette oh, you already noticed to use #2011 as reference issue. Please adjust your commit message accordingly.

My commit message already has "iox-#2011" as the first line of the commit message, but let me know if I need to change it to something else.

Can you add #include "iceoryx_hoofs/cxx/variant.hpp" at the top of variant.inl?

It looks like it is already there on the release_2.0 branch: https://github.com/eclipse-iceoryx/iceoryx/blob/release_2.0/iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant.inl#L21

Oh, I confused the files. It seems the variant_queue.inl file is responsible for the CI failure.

@clalancette oh, you already noticed to use #2011 as reference issue. Please adjust your commit message accordingly.

My commit message already has "iox-#2011" as the first line of the commit message, but let me know if I need to change it to something else.

That's weird, it does not show up when I look at the commit. It says Silence some warnings ...

clalancette commented 5 months ago

That's weird, it does not show up when I look at the commit. It says Silence some warnings ...

You are right. I fixed it locally, but I forgot to push it. Pushed now.

elBoberido commented 5 months ago

That's weird, it does not show up when I look at the commit. It says Silence some warnings ...

You are right. I fixed it locally, but I forgot to push it. Pushed now.

:smile: classic

Can you add #include "iceoryx_hoofs/cxx/variant_queue.hpp" to iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant_queue.inl. It should fix the code linting job. I tested it locally.

What date would you prefer for a release?

clalancette commented 5 months ago

Can you add #include "iceoryx_hoofs/cxx/variant_queue.hpp" to iceoryx_hoofs/include/iceoryx_hoofs/internal/cxx/variant_queue.inl. It should fix the code linting job. I tested it locally.

Ah, great. I've now updated and pushed that in 434ee45. :crossed_fingers:

What date would you prefer for a release?

It is not a huge rush for us to get a release with this, but in the next month or so would be great.

elBoberido commented 5 months ago

What date would you prefer for a release?

It is not a huge rush for us to get a release with this, but in the next month or so would be great.

Let's see, maybe until then we find the time for the v3.0 release and also bring it to the ROS world.

clalancette commented 5 months ago

Thank you!