aboutsummaryrefslogtreecommitdiff
path: root/nbd/server.c
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2020-09-30 17:58:57 +0200
committerEric Blake <eblake@redhat.com>2020-10-09 15:04:32 -0500
commitbbc35fc20e6efcb9f177668c04ee05f25a0a2e65 (patch)
treeb3c68ce93396d5b7edf47a6db8ecc07651d89a93 /nbd/server.c
parent4a7c0bd9dcb08798c6f82e55b5a3423f7ee669f1 (diff)
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>
Diffstat (limited to 'nbd/server.c')
-rw-r--r--nbd/server.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nbd/server.c b/nbd/server.c
index f74766add7..f25cffa334 100644
--- a/nbd/server.c
+++ b/nbd/server.c
@@ -556,7 +556,7 @@ static int nbd_negotiate_handle_info(NBDClient *client, Error **errp)
NBDExport *exp;
uint16_t requests;
uint16_t request;
- uint32_t namelen;
+ uint32_t namelen = 0;
bool sendname = false;
bool blocksize = false;
uint32_t sizes[3];