[libvirt] [PATCH] Fix two uninitialized variable warnings
Wen Congyang
wency at cn.fujitsu.com
Tue May 10 06:57:32 UTC 2011
At 05/10/2011 02:40 PM, Matthias Bolte Write:
> gcc only reports them when compiling with -O3.
I compile libvirt with -O3, and recieve the same warnings.
ACK.
> ---
> src/util/interface.c | 2 +-
> tools/virsh.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/util/interface.c b/src/util/interface.c
> index 5e1987a..04a922c 100644
> --- a/src/util/interface.c
> +++ b/src/util/interface.c
> @@ -91,7 +91,7 @@ ifaceGetFlags(const char *ifname, short *flags) {
>
> int
> ifaceIsUp(const char *ifname, bool *up) {
> - short flags;
> + short flags = 0;
> int rc = ifaceGetFlags(ifname, &flags);
>
> if (rc)
> diff --git a/tools/virsh.c b/tools/virsh.c
> index 2b16714..8b5572c 100644
> --- a/tools/virsh.c
> +++ b/tools/virsh.c
> @@ -2857,7 +2857,7 @@ static bool
> cmdSetvcpus(vshControl *ctl, const vshCmd *cmd)
> {
> virDomainPtr dom;
> - int count;
> + int count = 0;
> bool ret = true;
> int maximum = vshCommandOptBool(cmd, "maximum");
> int config = vshCommandOptBool(cmd, "config");
More information about the libvir-list
mailing list