qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [Qemu-trivial] [PATCH] migration: Fix compiler warning


From: Michael Tokarev
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] migration: Fix compiler warning ('caps' may be used uninitialized)
Date: Sat, 05 Oct 2013 13:19:26 +0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130922 Icedove/17.0.9

05.10.2013 13:15, Michael Tokarev пишет:
Okay.  This takes just too long and too many people
are affected.  I'll just set the variable in question
(caps) to NULL at entry for now, -- it is not a critical
path and the current code is correct anyway.  This is
becoming ridiculous, when there are so many different
opinions about such a trivial thing, with the result
being that nothing is fixed.  Setting it to NULL at
least will let a buildbot to be fixed for now.

Forgot the patch itself.  It is the shortest from all
already proposed ;)

Author: Michael Tokarev <address@hidden>
Date:   Sat Oct 5 13:18:28 2013 +0400

    migration: Fix compiler warning ('caps' may be used uninitialized)

    Signed-off-by: Michael Tokarev <address@hidden>

diff --git a/migration.c b/migration.c
index b4f8462..2b1ab20 100644
--- a/migration.c
+++ b/migration.c
@@ -150,6 +150,7 @@ MigrationCapabilityStatusList *qmp_query_migrate_capabilitie
     MigrationState *s = migrate_get_current();
     int i;

+    caps = NULL; /* silence compiler warning */
     for (i = 0; i < MIGRATION_CAPABILITY_MAX; i++) {
         if (head == NULL) {
             head = g_malloc0(sizeof(*caps));


Thanks,

/mjt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]