On Wed, Jul 17, 2024 at 8:01 AM Ilya Maximets <[email protected]> wrote:
>
> For some reason gcc 14.1.1 from Fedora 41 thinks that the variable
> may end up not initialized:
>
>  ofproto/ofproto-dpif-xlate.c: In function 'compose_sample_action':
>  ofproto/ofproto-dpif-xlate.c:3465:40:
>           error: 'observe_offset' may be used uninitialized
>   3465 |         ctx->xout->last_observe_offset = observe_offset;
>        |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
>  ofproto/ofproto-dpif-xlate.c:3418:12:
>           note: 'observe_offset' was declared here
>   3418 |     size_t observe_offset;
>        |            ^~~~~~~~~~~~~~
>
> We have an assertion in the code to ensure that at least one of
> the actions is present (userspace or psample), so the variable
> should actually be always initialized.
>
> Initialize explicitly just to silence the warning.
>
> Fixes: 516569d31fbf ("ofproto: xlate: Make sampled drops explicit.")
> Signed-off-by: Ilya Maximets <[email protected]>
> ---

Acked-by: Mike Pattrick <[email protected]>

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to