With gcc 7.3.0 a warning is given about two variables possibly being uninitialized in compose_sample_action(). The code path only allows the variables to be used if they've been initialized, so this warning is incorrect. However, this change allows a clean build.
Signed-off-by: Justin Pettit <jpet...@ovn.org> --- ofproto/ofproto-dpif-xlate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ofproto/ofproto-dpif-xlate.c b/ofproto/ofproto-dpif-xlate.c index 2195ea3537b9..84cce811bd1c 100644 --- a/ofproto/ofproto-dpif-xlate.c +++ b/ofproto/ofproto-dpif-xlate.c @@ -3068,7 +3068,7 @@ compose_sample_action(struct xlate_ctx *ctx, /* When meter action is not required, avoid generate sample action * for 100% sampling rate. */ bool is_sample = probability < UINT32_MAX || meter_id != UINT32_MAX; - size_t sample_offset, actions_offset; + size_t sample_offset = 0, actions_offset = 0; if (is_sample) { sample_offset = nl_msg_start_nested(ctx->odp_actions, OVS_ACTION_ATTR_SAMPLE); -- 2.17.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev