qemu-char: Fix compiler warning (-Wuninitialized)
PATCH 1/1 qemu-char: Fix compiler warning (-Wuninitialized)
qemu-char.c:155:8: warning:
'res' may be used uninitialized in this function [-Wuninitialized]
Signed-off-by Stefan Weil <[email protected]>
--- qemu-char.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
qemu-char.c +1 -1
@@ -133,7 +133,7 @@ int qemu_chr_fe_write(CharDriverState *s, const uint8_t *buf, int len)int qemu_chr_fe_write_all (CharDriverState *s,const uint8_t *buf,int len) {int offset =0 ; -int res; +int res =0 ;qemu_mutex_lock (&s->chr_write_lock);while (offset < len) {
Signature · 1 line
1.7.10.4
Quoted 2 lines · Stefan Weil
qemu-char.c:155:8: warning:
'res' may be used uninitialized in this function [-Wuninitialized]
Igor beat you to it:
https://lists.gnu.org/archive/html/qemu-devel/2014-06/msg05986.html
Signature · 2 lines
Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org