nbd: silence maybe-uninitialized warnings
commitbbc35fc20e6efcb9f177668c04ee05f25a0a2e65
authorChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 30 Sep 2020 15:58:57 +0000 (30 17:58 +0200)
committerEric Blake <eblake@redhat.com>
Fri, 9 Oct 2020 20:04:32 +0000 (9 15:04 -0500)
treeb3c68ce93396d5b7edf47a6db8ecc07651d89a93
parent4a7c0bd9dcb08798c6f82e55b5a3423f7ee669f1
nbd: silence maybe-uninitialized warnings

gcc 10 from Fedora 32 gives me:

Compiling C object libblock.fa.p/nbd_server.c.o
../nbd/server.c: In function ‘nbd_co_client_start’:
../nbd/server.c:625:14: error: ‘namelen’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
  625 |         rc = nbd_negotiate_send_info(client, NBD_INFO_NAME, namelen, name,
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  626 |                                      errp);
      |                                      ~~~~~
../nbd/server.c:564:14: note: ‘namelen’ was declared here
  564 |     uint32_t namelen;
      |              ^~~~~~~
cc1: all warnings being treated as errors

As I cannot see how this can happen, let uns silence the warning.

Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Message-Id: <20200930155859.303148-3-borntraeger@de.ibm.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
nbd/server.c