mirror of https://gitee.com/openkylin/libvirt.git
![]() GCC 10 complains about variables may be used uninitialized. Even though it might be false positives, we can easily avoid them. Avoiding ../src/storage/storage_backend_iscsi_direct.c:634:11: error: ‘nb_block’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 634 | while (lba < nb_block) { | ^ ../src/storage/storage_backend_iscsi_direct.c:619:14: note: ‘nb_block’ was declared here 619 | uint64_t nb_block; | ^~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:637:16: error: ‘block_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 637 | task = iscsi_write16_sync(iscsi, lun, lba, data, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 638 | block_size * to_write, | ~~~~~~~~~~~~~~~~~~~~~~ 639 | block_size, 0, 0, 0, 0, 0); | ~~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:618:14: note: ‘block_size’ was declared here 618 | uint32_t block_size; | ^~~~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c: In function ‘virStorageBackendISCSIDirectRefreshPool’: ../src/storage/storage_backend_iscsi_direct.c:320:39: error: ‘nb_block’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 320 | vol->target.capacity = block_size * nb_block; | ~~~~~~~~~~~^~~~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:306:14: note: ‘nb_block’ was declared here 306 | uint64_t nb_block; | ^~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:320:39: error: ‘block_size’ may be used uninitialized in this function [-Werror=maybe-uninitialized] 320 | vol->target.capacity = block_size * nb_block; | ~~~~~~~~~~~^~~~~~~~~~ ../src/storage/storage_backend_iscsi_direct.c:305:14: note: ‘block_size’ was declared here 305 | uint32_t block_size; | ^~~~~~~~~~ Signed-off-by: Boris Fiuczynski <fiuczy@linux.ibm.com> Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Erik Skultety <eskultet@redhat.com> |
||
---|---|---|
.. | ||
meson.build | ||
parthelper.c | ||
storage_backend.c | ||
storage_backend.h | ||
storage_backend_disk.c | ||
storage_backend_disk.h | ||
storage_backend_fs.c | ||
storage_backend_fs.h | ||
storage_backend_gluster.c | ||
storage_backend_gluster.h | ||
storage_backend_iscsi.c | ||
storage_backend_iscsi.h | ||
storage_backend_iscsi_direct.c | ||
storage_backend_iscsi_direct.h | ||
storage_backend_logical.c | ||
storage_backend_logical.h | ||
storage_backend_mpath.c | ||
storage_backend_mpath.h | ||
storage_backend_rbd.c | ||
storage_backend_rbd.h | ||
storage_backend_scsi.c | ||
storage_backend_scsi.h | ||
storage_backend_sheepdog.c | ||
storage_backend_sheepdog.h | ||
storage_backend_sheepdog_priv.h | ||
storage_backend_vstorage.c | ||
storage_backend_vstorage.h | ||
storage_backend_zfs.c | ||
storage_backend_zfs.h | ||
storage_driver.c | ||
storage_driver.h | ||
storage_file_fs.c | ||
storage_file_fs.h | ||
storage_file_gluster.c | ||
storage_file_gluster.h | ||
storage_util.c | ||
storage_util.h | ||
virtstoraged.init.in | ||
virtstoraged.service.in | ||
virtstoraged.sysconf |