Commit a69deb64 authored by kenton@google.com's avatar kenton@google.com

Explicitly identify superclass in initializer lists for generated message

classes.  This avoids a warning when using GCC's -pedantic option.
parent 4410396f
...@@ -712,6 +712,9 @@ GenerateInitializerList(io::Printer* printer) { ...@@ -712,6 +712,9 @@ GenerateInitializerList(io::Printer* printer) {
printer->Indent(); printer->Indent();
printer->Indent(); printer->Indent();
printer->Print(
"::google::protobuf::Message(),\n");
if (descriptor_->extension_range_count() > 0) { if (descriptor_->extension_range_count() > 0) {
printer->Print( printer->Print(
"_extensions_(&$classname$_descriptor_,\n" "_extensions_(&$classname$_descriptor_,\n"
......
...@@ -358,14 +358,16 @@ const int FileDescriptorSet::_offsets_[1] = { ...@@ -358,14 +358,16 @@ const int FileDescriptorSet::_offsets_[1] = {
}; };
FileDescriptorSet::FileDescriptorSet() FileDescriptorSet::FileDescriptorSet()
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
if (this == &default_instance_) { if (this == &default_instance_) {
} }
} }
FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet& from) FileDescriptorSet::FileDescriptorSet(const FileDescriptorSet& from)
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
MergeFrom(from); MergeFrom(from);
} }
...@@ -530,7 +532,8 @@ const int FileDescriptorProto::_offsets_[8] = { ...@@ -530,7 +532,8 @@ const int FileDescriptorProto::_offsets_[8] = {
}; };
FileDescriptorProto::FileDescriptorProto() FileDescriptorProto::FileDescriptorProto()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
package_(const_cast< ::std::string*>(&_default_package_)), package_(const_cast< ::std::string*>(&_default_package_)),
options_(NULL) { options_(NULL) {
...@@ -541,7 +544,8 @@ FileDescriptorProto::FileDescriptorProto() ...@@ -541,7 +544,8 @@ FileDescriptorProto::FileDescriptorProto()
} }
FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from) FileDescriptorProto::FileDescriptorProto(const FileDescriptorProto& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
package_(const_cast< ::std::string*>(&_default_package_)), package_(const_cast< ::std::string*>(&_default_package_)),
options_(NULL) { options_(NULL) {
...@@ -917,7 +921,8 @@ const int DescriptorProto_ExtensionRange::_offsets_[2] = { ...@@ -917,7 +921,8 @@ const int DescriptorProto_ExtensionRange::_offsets_[2] = {
}; };
DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
start_(0), start_(0),
end_(0) { end_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -926,7 +931,8 @@ DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange() ...@@ -926,7 +931,8 @@ DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange()
} }
DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from) DescriptorProto_ExtensionRange::DescriptorProto_ExtensionRange(const DescriptorProto_ExtensionRange& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
start_(0), start_(0),
end_(0) { end_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -1127,7 +1133,8 @@ const int DescriptorProto::_offsets_[7] = { ...@@ -1127,7 +1133,8 @@ const int DescriptorProto::_offsets_[7] = {
}; };
DescriptorProto::DescriptorProto() DescriptorProto::DescriptorProto()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
options_(NULL) { options_(NULL) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -1137,7 +1144,8 @@ DescriptorProto::DescriptorProto() ...@@ -1137,7 +1144,8 @@ DescriptorProto::DescriptorProto()
} }
DescriptorProto::DescriptorProto(const DescriptorProto& from) DescriptorProto::DescriptorProto(const DescriptorProto& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
options_(NULL) { options_(NULL) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -1565,7 +1573,8 @@ const int FieldDescriptorProto::_offsets_[8] = { ...@@ -1565,7 +1573,8 @@ const int FieldDescriptorProto::_offsets_[8] = {
}; };
FieldDescriptorProto::FieldDescriptorProto() FieldDescriptorProto::FieldDescriptorProto()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
number_(0), number_(0),
label_(1), label_(1),
...@@ -1581,7 +1590,8 @@ FieldDescriptorProto::FieldDescriptorProto() ...@@ -1581,7 +1590,8 @@ FieldDescriptorProto::FieldDescriptorProto()
} }
FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from) FieldDescriptorProto::FieldDescriptorProto(const FieldDescriptorProto& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
number_(0), number_(0),
label_(1), label_(1),
...@@ -1984,7 +1994,8 @@ const int EnumDescriptorProto::_offsets_[3] = { ...@@ -1984,7 +1994,8 @@ const int EnumDescriptorProto::_offsets_[3] = {
}; };
EnumDescriptorProto::EnumDescriptorProto() EnumDescriptorProto::EnumDescriptorProto()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
options_(NULL) { options_(NULL) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -1994,7 +2005,8 @@ EnumDescriptorProto::EnumDescriptorProto() ...@@ -1994,7 +2005,8 @@ EnumDescriptorProto::EnumDescriptorProto()
} }
EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from) EnumDescriptorProto::EnumDescriptorProto(const EnumDescriptorProto& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
options_(NULL) { options_(NULL) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -2222,7 +2234,8 @@ const int EnumValueDescriptorProto::_offsets_[3] = { ...@@ -2222,7 +2234,8 @@ const int EnumValueDescriptorProto::_offsets_[3] = {
}; };
EnumValueDescriptorProto::EnumValueDescriptorProto() EnumValueDescriptorProto::EnumValueDescriptorProto()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
number_(0), number_(0),
options_(NULL) { options_(NULL) {
...@@ -2233,7 +2246,8 @@ EnumValueDescriptorProto::EnumValueDescriptorProto() ...@@ -2233,7 +2246,8 @@ EnumValueDescriptorProto::EnumValueDescriptorProto()
} }
EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProto& from) EnumValueDescriptorProto::EnumValueDescriptorProto(const EnumValueDescriptorProto& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
number_(0), number_(0),
options_(NULL) { options_(NULL) {
...@@ -2463,7 +2477,8 @@ const int ServiceDescriptorProto::_offsets_[3] = { ...@@ -2463,7 +2477,8 @@ const int ServiceDescriptorProto::_offsets_[3] = {
}; };
ServiceDescriptorProto::ServiceDescriptorProto() ServiceDescriptorProto::ServiceDescriptorProto()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
options_(NULL) { options_(NULL) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -2473,7 +2488,8 @@ ServiceDescriptorProto::ServiceDescriptorProto() ...@@ -2473,7 +2488,8 @@ ServiceDescriptorProto::ServiceDescriptorProto()
} }
ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& from) ServiceDescriptorProto::ServiceDescriptorProto(const ServiceDescriptorProto& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
options_(NULL) { options_(NULL) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -2703,7 +2719,8 @@ const int MethodDescriptorProto::_offsets_[4] = { ...@@ -2703,7 +2719,8 @@ const int MethodDescriptorProto::_offsets_[4] = {
}; };
MethodDescriptorProto::MethodDescriptorProto() MethodDescriptorProto::MethodDescriptorProto()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
input_type_(const_cast< ::std::string*>(&_default_input_type_)), input_type_(const_cast< ::std::string*>(&_default_input_type_)),
output_type_(const_cast< ::std::string*>(&_default_output_type_)), output_type_(const_cast< ::std::string*>(&_default_output_type_)),
...@@ -2715,7 +2732,8 @@ MethodDescriptorProto::MethodDescriptorProto() ...@@ -2715,7 +2732,8 @@ MethodDescriptorProto::MethodDescriptorProto()
} }
MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from) MethodDescriptorProto::MethodDescriptorProto(const MethodDescriptorProto& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
name_(const_cast< ::std::string*>(&_default_name_)), name_(const_cast< ::std::string*>(&_default_name_)),
input_type_(const_cast< ::std::string*>(&_default_input_type_)), input_type_(const_cast< ::std::string*>(&_default_input_type_)),
output_type_(const_cast< ::std::string*>(&_default_output_type_)), output_type_(const_cast< ::std::string*>(&_default_output_type_)),
...@@ -3006,7 +3024,8 @@ const int FileOptions::_offsets_[4] = { ...@@ -3006,7 +3024,8 @@ const int FileOptions::_offsets_[4] = {
}; };
FileOptions::FileOptions() FileOptions::FileOptions()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
java_package_(const_cast< ::std::string*>(&_default_java_package_)), java_package_(const_cast< ::std::string*>(&_default_java_package_)),
java_outer_classname_(const_cast< ::std::string*>(&_default_java_outer_classname_)), java_outer_classname_(const_cast< ::std::string*>(&_default_java_outer_classname_)),
java_multiple_files_(false), java_multiple_files_(false),
...@@ -3017,7 +3036,8 @@ FileOptions::FileOptions() ...@@ -3017,7 +3036,8 @@ FileOptions::FileOptions()
} }
FileOptions::FileOptions(const FileOptions& from) FileOptions::FileOptions(const FileOptions& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
java_package_(const_cast< ::std::string*>(&_default_java_package_)), java_package_(const_cast< ::std::string*>(&_default_java_package_)),
java_outer_classname_(const_cast< ::std::string*>(&_default_java_outer_classname_)), java_outer_classname_(const_cast< ::std::string*>(&_default_java_outer_classname_)),
java_multiple_files_(false), java_multiple_files_(false),
...@@ -3277,7 +3297,8 @@ const int MessageOptions::_offsets_[1] = { ...@@ -3277,7 +3297,8 @@ const int MessageOptions::_offsets_[1] = {
}; };
MessageOptions::MessageOptions() MessageOptions::MessageOptions()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
message_set_wire_format_(false) { message_set_wire_format_(false) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
if (this == &default_instance_) { if (this == &default_instance_) {
...@@ -3285,7 +3306,8 @@ MessageOptions::MessageOptions() ...@@ -3285,7 +3306,8 @@ MessageOptions::MessageOptions()
} }
MessageOptions::MessageOptions(const MessageOptions& from) MessageOptions::MessageOptions(const MessageOptions& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
message_set_wire_format_(false) { message_set_wire_format_(false) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
MergeFrom(from); MergeFrom(from);
...@@ -3463,7 +3485,8 @@ const int FieldOptions::_offsets_[2] = { ...@@ -3463,7 +3485,8 @@ const int FieldOptions::_offsets_[2] = {
}; };
FieldOptions::FieldOptions() FieldOptions::FieldOptions()
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
ctype_(1), ctype_(1),
experimental_map_key_(const_cast< ::std::string*>(&_default_experimental_map_key_)) { experimental_map_key_(const_cast< ::std::string*>(&_default_experimental_map_key_)) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -3472,7 +3495,8 @@ FieldOptions::FieldOptions() ...@@ -3472,7 +3495,8 @@ FieldOptions::FieldOptions()
} }
FieldOptions::FieldOptions(const FieldOptions& from) FieldOptions::FieldOptions(const FieldOptions& from)
: _cached_size_(0), : ::google::protobuf::Message(),
_cached_size_(0),
ctype_(1), ctype_(1),
experimental_map_key_(const_cast< ::std::string*>(&_default_experimental_map_key_)) { experimental_map_key_(const_cast< ::std::string*>(&_default_experimental_map_key_)) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
...@@ -3666,14 +3690,16 @@ const int EnumOptions::_offsets_[1] = { ...@@ -3666,14 +3690,16 @@ const int EnumOptions::_offsets_[1] = {
}; };
EnumOptions::EnumOptions() EnumOptions::EnumOptions()
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
if (this == &default_instance_) { if (this == &default_instance_) {
} }
} }
EnumOptions::EnumOptions(const EnumOptions& from) EnumOptions::EnumOptions(const EnumOptions& from)
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
MergeFrom(from); MergeFrom(from);
} }
...@@ -3779,14 +3805,16 @@ const int EnumValueOptions::_offsets_[1] = { ...@@ -3779,14 +3805,16 @@ const int EnumValueOptions::_offsets_[1] = {
}; };
EnumValueOptions::EnumValueOptions() EnumValueOptions::EnumValueOptions()
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
if (this == &default_instance_) { if (this == &default_instance_) {
} }
} }
EnumValueOptions::EnumValueOptions(const EnumValueOptions& from) EnumValueOptions::EnumValueOptions(const EnumValueOptions& from)
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
MergeFrom(from); MergeFrom(from);
} }
...@@ -3892,14 +3920,16 @@ const int ServiceOptions::_offsets_[1] = { ...@@ -3892,14 +3920,16 @@ const int ServiceOptions::_offsets_[1] = {
}; };
ServiceOptions::ServiceOptions() ServiceOptions::ServiceOptions()
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
if (this == &default_instance_) { if (this == &default_instance_) {
} }
} }
ServiceOptions::ServiceOptions(const ServiceOptions& from) ServiceOptions::ServiceOptions(const ServiceOptions& from)
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
MergeFrom(from); MergeFrom(from);
} }
...@@ -4005,14 +4035,16 @@ const int MethodOptions::_offsets_[1] = { ...@@ -4005,14 +4035,16 @@ const int MethodOptions::_offsets_[1] = {
}; };
MethodOptions::MethodOptions() MethodOptions::MethodOptions()
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
if (this == &default_instance_) { if (this == &default_instance_) {
} }
} }
MethodOptions::MethodOptions(const MethodOptions& from) MethodOptions::MethodOptions(const MethodOptions& from)
: _cached_size_(0) { : ::google::protobuf::Message(),
_cached_size_(0) {
::memset(_has_bits_, 0, sizeof(_has_bits_)); ::memset(_has_bits_, 0, sizeof(_has_bits_));
MergeFrom(from); MergeFrom(from);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment