diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-14 12:41:10 -0800 |
---|---|---|
committer | Feng Xiao <xfxyjwf@gmail.com> | 2014-11-14 12:41:10 -0800 |
commit | 3eb55df6a4624f6124d96ea52a7c2915ee7957fd (patch) | |
tree | 52283ef5e1ef758b4449fe4dc4c9b8eec1cecf47 /src/google/protobuf/compiler/parser.cc | |
parent | f157a5651c79a7a36e242af216a5d5b383ba8af2 (diff) | |
download | protobuf-3eb55df6a4624f6124d96ea52a7c2915ee7957fd.tar.gz protobuf-3eb55df6a4624f6124d96ea52a7c2915ee7957fd.tar.bz2 protobuf-3eb55df6a4624f6124d96ea52a7c2915ee7957fd.zip |
Report a warning if the proto file doesn't have a syntax statement.
Diffstat (limited to 'src/google/protobuf/compiler/parser.cc')
-rw-r--r-- | src/google/protobuf/compiler/parser.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc index 0ed80d54..41b73678 100644 --- a/src/google/protobuf/compiler/parser.cc +++ b/src/google/protobuf/compiler/parser.cc @@ -468,6 +468,10 @@ bool Parser::Parse(io::Tokenizer* input, FileDescriptorProto* file) { // Store the syntax into the file. if (file != NULL) file->set_syntax(syntax_identifier_); } else if (!stop_after_syntax_identifier_) { + GOOGLE_LOG(WARNING) << "No syntax specified for the proto file. " + << "Please use 'syntax = \"proto2\";' or " + << "'syntax = \"proto3\";' to specify a syntax " + << "version. (Defaulted to proto2 syntax.)"; syntax_identifier_ = "proto2"; } |