diff options
author | Ilya Maximets <i.maximets@ovn.org> | 2021-07-22 13:29:11 +0200 |
---|---|---|
committer | Ilya Maximets <i.maximets@ovn.org> | 2021-07-23 15:40:08 +0200 |
commit | 43b7d960af5616b5e2bc65b67fc6e21e76d6155c (patch) | |
tree | b8fcc89d1c97a471c8b2d3a376dd0cdf6542ff92 | |
parent | f05d6d623e7054e65f3a8f24e2dfbf8f120764ed (diff) | |
download | openvswitch-43b7d960af5616b5e2bc65b67fc6e21e76d6155c.tar.gz |
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@ovn.org>
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
-rw-r--r-- | lib/netdev-dummy.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |