aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/compiler/parser.cc
diff options
context:
space:
mode:
authorFeng Xiao <xfxyjwf@gmail.com>2014-12-02 15:45:36 -0800
committerFeng Xiao <xfxyjwf@gmail.com>2014-12-02 15:45:36 -0800
commite559b51b8de7d1d2ca35575b10176340fcc7bb82 (patch)
treef971fe0caf13636cdfde89f9258273a505150e2f /src/google/protobuf/compiler/parser.cc
parent7f2a9fb1af432a9831b3e6769905601d72c29796 (diff)
parent3eb55df6a4624f6124d96ea52a7c2915ee7957fd (diff)
downloadprotobuf-e559b51b8de7d1d2ca35575b10176340fcc7bb82.tar.gz
protobuf-e559b51b8de7d1d2ca35575b10176340fcc7bb82.tar.bz2
protobuf-e559b51b8de7d1d2ca35575b10176340fcc7bb82.zip
Merge pull request #81 from xfxyjwf/syntax_warning
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.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/google/protobuf/compiler/parser.cc b/src/google/protobuf/compiler/parser.cc
index 4b3efe48..fe697acf 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";
}