After protobuf 3.8
We can use this
parse.AllowUnknownField(true);
.
But it well report warning msg to stderr in default, and the Parser has another API to catch the msg:
void Parser::RecordErrorsTo(io::ErrorCollector * error_collector)
reference: https://github.com/protocolbuffers/protobuf/issues/5465