Skip to content

Add warning suppression macro for unused static functions - #226

Open
luca-della-vedova wants to merge 2 commits into
gazebosim:mainfrom
luca-della-vedova:luca/static_function_warning
Open

Add warning suppression macro for unused static functions#226
luca-della-vedova wants to merge 2 commits into
gazebosim:mainfrom
luca-della-vedova:luca/static_function_warning

Conversation

@luca-della-vedova

Copy link
Copy Markdown
Contributor

🎉 New feature

Summary

Similar to #217, add warning suppression for unused static functions.
Context in gazebosim/gz-common#874, where we are trying to use a header-only library compiled with internal linkage (hence all functions are set as static). Unless we use every single function the compiler will complain that some of the libraries APIs are not used, which is clearly a spurious warning.

Backport Policy

This is really only needed from Jetty onwards (as per upstream PR), but it doesn't hurt.

  • This is safe to backport to the following versions:
    • Jetty
    • Ionic
    • Harmonic
    • Fortress
  • This should not be backported
  • I am not sure
  • Other (fill in yourself)

Test it

Testing in CI, first commit adds the test without the warning suppression macro and should fail, second commit will add the macro and should make CI green again.

Checklist

  • Signed all commits for DCO
  • Added a screen capture or video to the PR description that demonstrates the feature
  • 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)
  • Updated Bazel files (if adding new files). Created an issue otherwise.
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers
  • Was GenAI used to generate this PR? If so, make sure to add "Assisted-by" to your commits. (See this policy for more info.)

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

Backports: If this is a backport, please use Rebase and Merge instead.

Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Signed-off-by: Luca Della Vedova <lucadv@intrinsic.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Inbox

Development

Successfully merging this pull request may close these issues.

2 participants