tools: fix compile errors with -Og
PATCH 1/1 tools: fix compile errors with -Og
At least gcc-4.8 and older fails to recognize that err is always
initialized, the build fails:
xc_cpupool.c: In function 'xc_cpupool_removecpu':
xc_cpupool.c:168:5: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return err;
Fix this in blktap2 and libxc.
--- tools/blktap2/drivers/tapdisk-vbd.c | 6 +++--- tools/libxc/xc_cpupool.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
tools/blktap2/drivers/tapdisk-vbd.c +3 -3
@@ -516,7 +516,7 @@ tapdisk_vbd_free_stack(td_vbd_t *vbd)int tapdisk_vbd_open_stack (td_vbd_t *vbd,uint16_t storage,td_flag_t flags) { -int i, err; +int i, err =0 ; vbd->flags = flags; vbd->storage = storage;
@@ -932,7 +932,7 @@ tapdisk_vbd_open_image(td_vbd_t *vbd, td_image_t *image)static int tapdisk_vbd_close_and_reopen_image (td_vbd_t *vbd,td_image_t *image) { -int i, err; +int i, err =0 ;td_close (image);
@@ -972,7 +972,7 @@ tapdisk_vbd_pause(td_vbd_t *vbd)int tapdisk_vbd_resume (td_vbd_t *vbd,const char *path,uint16_t drivertype) { -int i, err; +int i, err =0 ;if (!td_flag_test (vbd->state,TD_VBD_PAUSED )) {EPRINTF ("resume request for unpaused vbd %s\n" , vbd->name);
tools/libxc/xc_cpupool.c +1 -1
@@ -151,7 +151,7 @@ int xc_cpupool_removecpu(xc_interface *xch, int cpu) {unsigned retries; -int err; +int err =0 ;DECLARE_SYSCTL ; sysctl.cmd = XEN_SYSCTL_cpupool_op;
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 7 lines · Olaf Hering
At least gcc-4.8 and older fails to recognize that err is always initialized, the build fails:
xc_cpupool.c: In function 'xc_cpupool_removecpu':
xc_cpupool.c:168:5: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]
return err;
Quoted 6 lines
Fix this in blktap2 and libxc.
Signed-off-by Olaf Hering <[email protected]>Cc Ian Jackson <[email protected]>Cc Wei Liu <[email protected]>
Regards,
Dario
Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 11 lines · Olaf Hering
At least gcc-4.8 and older fails to recognize that err is always
initialized, the build fails:
xc_cpupool.c: In function 'xc_cpupool_removecpu':
xc_cpupool.c:168:5: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized]return err;Fix this in blktap2 and libxc.
Signed-off-by Olaf Hering <[email protected]>Cc Ian Jackson <[email protected]>Cc Wei Liu <[email protected]>
And queued.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel