diff --git a/ChangeLog b/ChangeLog index 9c2d4b0..9e294b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +protobuf-c (1.2.1) UNRELEASED + + [ Paolo Borelli ] + * protoc-c: Generate code that uses the universal zero initializer {0} when + initializing a oneof union. + protobuf-c (1.2.0) [ Robert Edmonds ] diff --git a/protoc-c/c_message.cc b/protoc-c/c_message.cc index 54d1847..cb9584d 100644 --- a/protoc-c/c_message.cc +++ b/protoc-c/c_message.cc @@ -236,8 +236,8 @@ GenerateStructDefinition(io::Printer* printer) { vars["foneofname"] = FullNameToUpper(oneof->full_name()); // Initialize the case enum printer->Print(vars, ", $foneofname$__NOT_SET"); - // Initialize the enum - printer->Print(", {}"); + // Initialize the union + printer->Print(", {0}"); } printer->Print(" }\n\n\n");