diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index a3fbf78a29..bf43cd4b9f 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -1176,7 +1176,8 @@ static upb_MessageValue jsondec_int(jsondec* d, const upb_FieldDef* f) { /* Parse UINT32 or UINT64 value. */ static upb_MessageValue jsondec_uint(jsondec* d, const upb_FieldDef* f) { - upb_MessageValue val = {0}; + upb_MessageValue val; + memset(&val, 0, sizeof(val)); switch (jsondec_peek(d)) { case JD_NUMBER: { @@ -1213,7 +1214,8 @@ static upb_MessageValue jsondec_uint(jsondec* d, const upb_FieldDef* f) { /* Parse DOUBLE or FLOAT value. */ static upb_MessageValue jsondec_double(jsondec* d, const upb_FieldDef* f) { upb_StringView str; - upb_MessageValue val = {0}; + upb_MessageValue val; + memset(&val, 0, sizeof(val)); switch (jsondec_peek(d)) { case JD_NUMBER: @@ -15755,7 +15757,8 @@ bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m, const upb_MiniTable* mt = upb_MessageDef_MiniTable(m); size_t i = *iter; size_t n = upb_MiniTable_FieldCount(mt); - const upb_MessageValue zero = {0}; + upb_MessageValue zero; + memset(&zero, 0, sizeof(zero)); UPB_UNUSED(ext_pool); // Iterate over normal fields, returning the first one that is set. diff --git a/ruby/ext/google/protobuf_c/ruby-upb.c b/ruby/ext/google/protobuf_c/ruby-upb.c index 0dc39db5ab..cebe248ba4 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -1176,7 +1176,8 @@ static upb_MessageValue jsondec_int(jsondec* d, const upb_FieldDef* f) { /* Parse UINT32 or UINT64 value. */ static upb_MessageValue jsondec_uint(jsondec* d, const upb_FieldDef* f) { - upb_MessageValue val = {0}; + upb_MessageValue val; + memset(&val, 0, sizeof(val)); switch (jsondec_peek(d)) { case JD_NUMBER: { @@ -1213,7 +1214,8 @@ static upb_MessageValue jsondec_uint(jsondec* d, const upb_FieldDef* f) { /* Parse DOUBLE or FLOAT value. */ static upb_MessageValue jsondec_double(jsondec* d, const upb_FieldDef* f) { upb_StringView str; - upb_MessageValue val = {0}; + upb_MessageValue val; + memset(&val, 0, sizeof(val)); switch (jsondec_peek(d)) { case JD_NUMBER: @@ -15243,7 +15245,8 @@ bool upb_Message_Next(const upb_Message* msg, const upb_MessageDef* m, const upb_MiniTable* mt = upb_MessageDef_MiniTable(m); size_t i = *iter; size_t n = upb_MiniTable_FieldCount(mt); - const upb_MessageValue zero = {0}; + upb_MessageValue zero; + memset(&zero, 0, sizeof(zero)); UPB_UNUSED(ext_pool); // Iterate over normal fields, returning the first one that is set.