qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] qemu-char: Fix compiler warning (-Wuninitialized)
@ 2014-06-25 18:54 Stefan Weil
  2014-06-25 19:04 ` Eric Blake
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Weil @ 2014-06-25 18:54 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-trivial, Paolo Bonzini, Stefan Weil

qemu-char.c:155:8: warning:
 'res' may be used uninitialized in this function [-Wuninitialized]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 qemu-char.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-char.c b/qemu-char.c
index c1ea84c..c65f81f 100644
--- a/qemu-char.c
+++ b/qemu-char.c
@@ -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) {
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] qemu-char: Fix compiler warning (-Wuninitialized)
  2014-06-25 18:54 [Qemu-devel] [PATCH] qemu-char: Fix compiler warning (-Wuninitialized) Stefan Weil
@ 2014-06-25 19:04 ` Eric Blake
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Blake @ 2014-06-25 19:04 UTC (permalink / raw)
  To: Stefan Weil, qemu-devel; +Cc: qemu-trivial, Paolo Bonzini

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

On 06/25/2014 12:54 PM, Stefan Weil wrote:
> 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

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-06-25 19:05 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-25 18:54 [Qemu-devel] [PATCH] qemu-char: Fix compiler warning (-Wuninitialized) Stefan Weil
2014-06-25 19:04 ` Eric Blake

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).