diff --git a/php/ext/google/protobuf/php-upb.c b/php/ext/google/protobuf/php-upb.c index 180b2a9b8660..55bedc6043f4 100644 --- a/php/ext/google/protobuf/php-upb.c +++ b/php/ext/google/protobuf/php-upb.c @@ -3082,7 +3082,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: { @@ -3119,7 +3120,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: @@ -15767,7 +15769,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 4eaaefe88d66..a8d241261493 100644 --- a/ruby/ext/google/protobuf_c/ruby-upb.c +++ b/ruby/ext/google/protobuf_c/ruby-upb.c @@ -2570,7 +2570,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: { @@ -2607,7 +2608,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: @@ -15255,7 +15257,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/upb/json/decode.c b/upb/json/decode.c index 8fe655ccfddf..5659a017aac8 100644 --- a/upb/json/decode.c +++ b/upb/json/decode.c @@ -711,7 +711,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: { @@ -748,7 +749,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: diff --git a/upb/reflection/message.c b/upb/reflection/message.c index 285418295a2e..f47a777bf46e 100644 --- a/upb/reflection/message.c +++ b/upb/reflection/message.c @@ -138,7 +138,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.