[ovs-git] [openvswitch/ovs] 43b7d9: netdev-dummy: Silence the 'may be uninitialized' w...

Ilya Maximets noreply at github.com
Fri Jul 23 13:42:39 UTC 2021


  Branch: refs/heads/master
  Home:   https://github.com/openvswitch/ovs
  Commit: 43b7d960af5616b5e2bc65b67fc6e21e76d6155c
      https://github.com/openvswitch/ovs/commit/43b7d960af5616b5e2bc65b67fc6e21e76d6155c
  Author: Ilya Maximets <i.maximets at ovn.org>
  Date:   2021-07-23 (Fri, 23 Jul 2021)

  Changed paths:
    M lib/netdev-dummy.c

  Log Message:
  -----------
  netdev-dummy: Silence the 'may be uninitialized' warning.

GCC 11 with -O1 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.

Acked-by: Ben Pfaff <blp at ovn.org>
Signed-off-by: Ilya Maximets <i.maximets at ovn.org>




More information about the git mailing list