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

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

Conversation

clalancette
Copy link
Contributor

@clalancette clalancette commented May 24, 2024

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. Code follows the coding style of CONTRIBUTING.md
  2. [N/A] Tests follow the best practice for testing
  3. 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. Commits messages are according to this guideline
  6. 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. 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

Copy link

codecov bot commented May 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

@@               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 Coverage Δ
unittests 77.71% <ø> (+0.01%) ⬆️
unittests_timing 15.15% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
...clude/iceoryx_hoofs/internal/cxx/variant_queue.inl 78.31% <ø> (ø)
...nternal/popo/building_blocks/chunk_distributor.inl 96.06% <ø> (ø)

... and 3 files with indirect coverage changes

@elBoberido
Copy link
Member

@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
Copy link
Member

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

@clalancette
Copy link
Contributor Author

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
Copy link
Member

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 clalancette force-pushed the clalancette/silence-gcc-13-warnings branch from 033ae7e to c671fbc Compare May 31, 2024 21:03
@clalancette
Copy link
Contributor Author

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
Copy link
Member

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.

😄 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?

… 13.

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.

Signed-off-by: Chris Lalancette <clalancette@gmail.com>
@clalancette clalancette force-pushed the clalancette/silence-gcc-13-warnings branch from c671fbc to 434ee45 Compare June 3, 2024 11:59
@clalancette
Copy link
Contributor Author

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. 🤞

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
Copy link
Member

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.

@elBoberido elBoberido self-requested a review June 3, 2024 12:26
@elBoberido elBoberido merged commit 32f83bc into eclipse-iceoryx:release_2.0 Jun 3, 2024
14 checks passed
@clalancette clalancette deleted the clalancette/silence-gcc-13-warnings branch June 3, 2024 12:30
@clalancette
Copy link
Contributor Author

Thank you!

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.

2 participants