提交 7f6d6b96 编写于 作者: J Julio Faracco 提交者: John Ferlan

util: clang is failing to compile due to unused variables.

After some recent patches, clang is throwing some errors related to
unused variables. This is not happening when we use GCC with -Werror
enabled. Only clang reports this warning.

make[3]: Entering directory '/home/julio/Desktop/virt/libvirt/src'
  CC       util/libvirt_util_la-virscsivhost.lo
  CC       util/libvirt_util_la-virusb.lo
  CC       util/libvirt_util_la-virmdev.lo
util/virmdev.c:373:36: error: unused variable 'ret' [-Werror,-Wunused-variable]
    VIR_AUTOPTR(virMediatedDevice) ret = virMediatedDeviceListSteal(list, dev);
                                   ^
1 error generated.
Makefile:11579: recipe for target 'util/libvirt_util_la-virmdev.lo' failed
make[3]: *** [util/libvirt_util_la-virmdev.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
util/virscsivhost.c:112:37: error: unused variable 'tmp' [-Werror,-Wunused-variable]
    VIR_AUTOPTR(virSCSIVHostDevice) tmp = virSCSIVHostDeviceListSteal(list, dev);
                                    ^
1 error generated.
Makefile:11411: recipe for target 'util/libvirt_util_la-virscsivhost.lo' failed
make[3]: *** [util/libvirt_util_la-virscsivhost.lo] Error 1
util/virusb.c:511:31: error: unused variable 'ret' [-Werror,-Wunused-variable]
    VIR_AUTOPTR(virUSBDevice) ret = virUSBDeviceListSteal(list, dev);
Signed-off-by: NJulio Faracco <jcfaracco@gmail.com>
Reviewed-by: NJohn Ferlan <jferlan@redhat.com>
上级 11a4d593
...@@ -370,7 +370,7 @@ void ...@@ -370,7 +370,7 @@ void
virMediatedDeviceListDel(virMediatedDeviceListPtr list, virMediatedDeviceListDel(virMediatedDeviceListPtr list,
virMediatedDevicePtr dev) virMediatedDevicePtr dev)
{ {
VIR_AUTOPTR(virMediatedDevice) ret = virMediatedDeviceListSteal(list, dev); virMediatedDeviceFree(virMediatedDeviceListSteal(list, dev));
} }
......
...@@ -109,7 +109,7 @@ void ...@@ -109,7 +109,7 @@ void
virSCSIVHostDeviceListDel(virSCSIVHostDeviceListPtr list, virSCSIVHostDeviceListDel(virSCSIVHostDeviceListPtr list,
virSCSIVHostDevicePtr dev) virSCSIVHostDevicePtr dev)
{ {
VIR_AUTOPTR(virSCSIVHostDevice) tmp = virSCSIVHostDeviceListSteal(list, dev); virSCSIVHostDeviceFree(virSCSIVHostDeviceListSteal(list, dev));
} }
......
...@@ -508,7 +508,7 @@ void ...@@ -508,7 +508,7 @@ void
virUSBDeviceListDel(virUSBDeviceListPtr list, virUSBDeviceListDel(virUSBDeviceListPtr list,
virUSBDevicePtr dev) virUSBDevicePtr dev)
{ {
VIR_AUTOPTR(virUSBDevice) ret = virUSBDeviceListSteal(list, dev); virUSBDeviceFree(virUSBDeviceListSteal(list, dev));
} }
virUSBDevicePtr virUSBDevicePtr
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册