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 <[email protected]>
---
 lib/netdev-dummy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/netdev-dummy.c b/lib/netdev-dummy.c
index 71df29184..1f386b81b 100644
--- a/lib/netdev-dummy.c
+++ b/lib/netdev-dummy.c
@@ -233,7 +233,7 @@ static int
 dummy_packet_stream_run(struct netdev_dummy *dev, struct dummy_packet_stream 
*s)
 {
     int error = 0;
-    size_t n;
+    size_t n = 0;
 
     stream_run(s->stream);
 
-- 
2.31.1

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

Reply via email to