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

avoid unused-parameter warning for c++ #10390

Merged
merged 3 commits into from
Aug 17, 2022

Conversation

marjoleinheyndrickx
Copy link
Contributor

In clang these two functions with an unused parameter give a Wunused-parameter warning. By removing the parametername the warning disappears.

@@ -467,7 +467,7 @@ class PROTOBUF_EXPORT PROTOBUF_ALIGNAS(8) Arena final {
}

template <typename U>
static Arena* GetArenaForAllocation(Rank2, const U* p) {
static Arena* GetArenaForAllocation(Rank2, const U*) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inside google these are used. Please switch the suppression technique to

(void)p;

@marjoleinheyndrickx
Copy link
Contributor Author

Suppression technique is switched to void cast, as suggested.

@fowles
Copy link
Contributor

fowles commented Aug 16, 2022

Thanks for the PR. I will merge this after our CI system finishes

@fowles fowles merged commit 3919d23 into protocolbuffers:main Aug 17, 2022
@marjoleinheyndrickx marjoleinheyndrickx deleted the wunused-parameters branch August 17, 2022 15:24
bithium pushed a commit to bithium/protobuf that referenced this pull request Sep 4, 2023
…used-parameters

avoid unused-parameter warning for c++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants