Message ID | 1457403820-2949-1-git-send-email-cardoe@cardoe.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Mon, Mar 07, 2016 at 08:23:39PM -0600, Doug Goldstein wrote: > Some versions of GCC complain that the 'firmware' variable can be used > uninitialized. It looks like the switch inside of the else case is just > confusing GCC. > > Signed-off-by: Doug Goldstein <cardoe@cardoe.com> Acked-by: Wei Liu <wei.liu2@citrix.com> > --- > CC: Ian Jackson <ian.jackson@eu.citrix.com> > CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com> > CC: Wei Liu <wei.liu2@citrix.com> > --- > tools/libxl/libxl_dom.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c > index 664adad..b825b98 100644 > --- a/tools/libxl/libxl_dom.c > +++ b/tools/libxl/libxl_dom.c > @@ -867,7 +867,7 @@ static int libxl__domain_firmware(libxl__gc *gc, > struct xc_dom_image *dom) > { > libxl_ctx *ctx = libxl__gc_owner(gc); > - const char *firmware; > + const char *firmware = NULL; > int e, rc; > int datalen = 0; > void *data; > -- > 2.4.10 >
On 3/8/16 9:38 AM, Wei Liu wrote: > On Mon, Mar 07, 2016 at 08:23:39PM -0600, Doug Goldstein wrote: >> Some versions of GCC complain that the 'firmware' variable can be used >> uninitialized. It looks like the switch inside of the else case is just >> confusing GCC. >> >> Signed-off-by: Doug Goldstein <cardoe@cardoe.com> > > Acked-by: Wei Liu <wei.liu2@citrix.com> > I sent these two together but they really aren't dependent on each other so this can go in without the other.
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c index 664adad..b825b98 100644 --- a/tools/libxl/libxl_dom.c +++ b/tools/libxl/libxl_dom.c @@ -867,7 +867,7 @@ static int libxl__domain_firmware(libxl__gc *gc, struct xc_dom_image *dom) { libxl_ctx *ctx = libxl__gc_owner(gc); - const char *firmware; + const char *firmware = NULL; int e, rc; int datalen = 0; void *data;
Some versions of GCC complain that the 'firmware' variable can be used uninitialized. It looks like the switch inside of the else case is just confusing GCC. Signed-off-by: Doug Goldstein <cardoe@cardoe.com> --- CC: Ian Jackson <ian.jackson@eu.citrix.com> CC: Stefano Stabellini <stefano.stabellini@eu.citrix.com> CC: Wei Liu <wei.liu2@citrix.com> --- tools/libxl/libxl_dom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)