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

Fix GCC/CMake warnings for Noble #2375

Merged
merged 6 commits into from
Apr 29, 2024
Merged

Fix GCC/CMake warnings for Noble #2375

merged 6 commits into from
Apr 29, 2024

Conversation

j-rivero
Copy link
Contributor

@j-rivero j-rivero commented Apr 17, 2024

🎉 New feature

Summary

Fix the CMake and GCC warnings that appeared when building on Noble. Each of the three commits is self-explanatory for review. The most tropical change is the 55498d807af68e18f5850f41adadbac3d7f5e9, quoting the commit description:

    GCC is emitting a warning about a possible dangling pointer on table
    like definitions:
    
    warning: possibly dangling reference to a temporary [-Wdangling-reference]
      660 |         auto const& table = get_current_events_table(state_indexes{});
          |                     ^~~~~
    
    Which I think that really comes from the use of state_indexes{} as
    argument:
    
      note: the temporary was destroyed at the end of the full expression
      660 |         auto const& table = get_current_events_table(state_indexes{});
          |                             ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
    
    Clang is quiet about this and make me think that is a false positive
    since the metaprogramming code is using just the type of the state_indexes
    as much as I can see.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Added example and/or tutorial
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

Signed-off-by: Jose Luis Rivero <[email protected]>
GCC is emitting a warning about a possible danling pointer on table
like definitions:

warning: possibly dangling reference to a temporary [-Wdangling-reference]
  660 |         auto const& table = get_current_events_table(state_indexes{});
      |                     ^~~~~

Which I think that really comes from the use of state_indexes{} as
argument:

  note: the temporary was destroyed at the end of the full expression
  660 |         auto const& table = get_current_events_table(state_indexes{});
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~

Clang is quiet about this and make me think that is a false positive
since the metaprogramming code is using just the type of the state_indexes
as much as I can see.

Signed-off-by: Jose Luis Rivero <[email protected]>
@j-rivero j-rivero requested a review from mjcarroll as a code owner April 17, 2024 17:35
@github-actions github-actions bot added the 🎵 harmonic Gazebo Harmonic label Apr 17, 2024
j-rivero and others added 3 commits April 18, 2024 16:22
…ns.hpp

Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
…ns.hpp

Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
…ns.hpp

Co-authored-by: Alejandro Hernández Cordero <[email protected]>
Signed-off-by: Jose Luis Rivero <[email protected]>
@j-rivero j-rivero requested a review from ahcorde April 18, 2024 14:22
@j-rivero j-rivero merged commit 3444847 into gz-sim8 Apr 29, 2024
8 checks passed
@j-rivero j-rivero deleted the jrivero/gz_sim8_noble branch April 29, 2024 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎵 harmonic Gazebo Harmonic
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants