[ovs-dev] [PATCH] netdev-dummy: Silence the 'may be uninitialized' warning.

Ben Pfaff blp at ovn.org
Thu Jul 22 18:52:31 UTC 2021


On Thu, Jul 22, 2021 at 01:33:37PM +0200, Ilya Maximets wrote:
> GCC 11 on Feodra 34 emits a false-positive warning like this:
> 
>  lib/netdev-dummy.c: In function ‘dummy_packet_stream_run’:
>  lib/netdev-dummy.c:284:16: error: ‘n’ may be used uninitialized in this
>                                    function [-Werror=maybe-uninitialized]
>   284 |             if (retval == n && dp_packet_size(&s->rxbuf) > 2) {
>       |                ^
> 
> This breaks the build with --enable-Werror.  Initializing 'n' to
> avoid the warning.
> 
> Signed-off-by: Ilya Maximets <i.maximets at ovn.org>

Acked-by: Ben Pfaff <blp at ovn.org>


More information about the dev mailing list