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 -Wunused-parameter in map<string, int> fields (fixes #8494) #8500

Merged
merged 2 commits into from Apr 16, 2021

Conversation

georgthegreat
Copy link
Contributor

This is a clumsy fix for #8494.
MWE is as follows:

syntax = "proto2";
optimize_for = "lite_runtime";
message M {
   map<string, int> field = 1;
}

During code generation, protoc will check for key / value types (corresponds to string_key / string_value variables all around).
If Utf8 validation will be disabled due to evaluation of GetUtf8CheckMode() to kNone, the Check() method will be generated as follows:

static void Check(ConstPtr p) {
}

This will trigger -Wunused-parameter.

@acozzette acozzette merged commit 0f25590 into protocolbuffers:master Apr 16, 2021
@georgthegreat georgthegreat deleted the validate-map branch April 17, 2021 09:23
@georgthegreat
Copy link
Contributor Author

@acozzette, could you, please, clarify the release timeline of protobuf=3.16 and protobuf=3.17 (as I see, 3.17.0-rc1 has just appeared in tags).

I have most of the patches submitted as PRs applied locally, and I am waiting for release to remove them. As I see, this PR is not included into 3.16.0-rc2 though it landed in the master some time ago.

Does protobuf follow the trunk based development practice?

@acozzette
Copy link
Member

We ordinarily do what one would call trunk-based development, but this is just an unusual case where we need to do two releases in quick succession. 3.16 is going to be a long-term support release for Java and will get fixes for at least a year, but we have other changes we want to release in 3.17 which we don't want to commit to supporting for that long. 3.17 includes everything merged to master up to this morning and I expect to release it either by tomorrow or early next week.

@georgthegreat
Copy link
Contributor Author

georgthegreat commented May 6, 2021

Thanks for the clarification!
I will wait for 3.17 to be released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants