From: Olaf Hering <olaf@aepfle.de>
To: xen-devel@lists.xen.org
Subject: [PATCH] libxl: fix unitialized variables in libxl__primary_console_find
Date: Mon, 30 Jul 2012 18:35:58 +0200 [thread overview]
Message-ID: <db8adce4f09307a90f96.1343666158@probook.site> (raw)
# HG changeset patch
# User Olaf Hering <olaf@aepfle.de>
# Date 1343662357 -7200
# Node ID db8adce4f09307a90f96103f7fd67efa97fc9ac0
# Parent cf0e661cb321b1c898c9008dc17ba21db434c976
libxl: fix unitialized variables in libxl__primary_console_find
gcc 4.5 as shipped with openSuSE 11.4 does not recognize the case of
LIBXL_DOMAIN_TYPE_INVALID properly:
cc1: warnings being treated as errors
libxl.c: In function 'libxl_primary_console_exec':
libxl.c:1408:14: error: 'domid' may be used uninitialized in this function
libxl.c:1409:9: error: 'cons_num' may be used uninitialized in this function
libxl.c:1410:24: error: 'type' may be used uninitialized in this function
libxl.c: In function 'libxl_primary_console_get_tty':
libxl.c:1421:14: error: 'domid' may be used uninitialized in this function
libxl.c:1422:9: error: 'cons_num' may be used uninitialized in this function
libxl.c:1423:24: error: 'type' may be used uninitialized in this function
make[3]: *** [libxl.o] Error 1
Fix this by adding a default case.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
diff -r cf0e661cb321 -r db8adce4f093 tools/libxl/libxl.c
--- a/tools/libxl/libxl.c
+++ b/tools/libxl/libxl.c
@@ -1590,6 +1590,7 @@ static int libxl__primary_console_find(l
case LIBXL_DOMAIN_TYPE_INVALID:
rc = ERROR_INVAL;
goto out;
+ default: abort();
}
}
next reply other threads:[~2012-07-30 16:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-30 16:35 Olaf Hering [this message]
2012-08-01 11:47 ` [PATCH] libxl: fix unitialized variables in libxl__primary_console_find Ian Campbell
-- strict thread matches above, loose matches on Subject: below --
2012-07-04 12:17 Olaf Hering
2012-07-23 10:51 ` Ian Campbell
2012-07-23 13:43 ` Olaf Hering
2012-07-24 8:45 ` Ian Campbell
2012-07-30 19:04 ` Olaf Hering
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=db8adce4f09307a90f96.1343666158@probook.site \
--to=olaf@aepfle.de \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).