On 7/7/22 13:51, Eelco Chaudron wrote:
> On 2 Jul 2022, at 5:18, Jianbo Liu wrote:
>> +static int
>> +tc_update_policer_action_stats(struct ofpbuf *msg,
>> + struct ofputil_meter_stats *stats)
>> +{
>> + struct ovs_flow_stats stats_dropped = {0};
>> + struct ovs_flow_stats stats_hw = {0};
>> + struct ovs_flow_stats stats_sw = {0};
>
> Here you want to keep the initializer as {}, as setting it to {0} gets
> some compilers to only initialize the first element. See also the robot
> complaining about this.
I don't think empty braces is a valid initializer from the
standard C point of view. We should use memset or a valid
designated initializer with at least one field specified.
OTOH, do we really need these to be initialized?
If the tc_parse_action_stats() call fails, we're not using
them, but if it succeeds, they should be initialized with
valid values by the function.
Best regards, Ilya Maximets.
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev