qemu-trivial
[Top][All Lists]
Advanced

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

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


From: Markus Armbruster
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] migration: Fix compiler warning ('caps' may be used uninitialized)
Date: Tue, 01 Oct 2013 10:07:39 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux)

Stefan Weil <address@hidden> writes:

> Am 30.09.2013 11:59, schrieb Markus Armbruster:
>> Stefan Weil <address@hidden> writes:
>>> Am 29.09.2013 22:13, schrieb Michael Tokarev:
>>>> 29.09.2013 19:41, Stefan Weil wrote:
>>>>> The QEMU buildbot default_i386_debian_6_0 shows this warning:
>>>>>
>>>>>    CC    migration.o
>>>>> migration.c: In function 'qmp_query_migrate_capabilities':
>>>>> migration.c:149: warning:
>>>>>   'caps' may be used uninitialized in this function
>>>> Gah, how disgusting.  The code is correct, yet gcc complains
>>>> needlessly...
>>> That's not the first time where we help the compiler by modifying the code.
>> It's also not the first time where attempting to "help" the compiler
>> made code less readable, or even less correct.  So let's be just as
>> careful as with "real" changes.
>
> Well, I try to do my best. ;-)
>
> Is there anything wrong with my patch? I think the code looks cleaner
> than before.

Michael disagrees, and I can see his points.

> If there is a better way to fix the problem that's fine, too.
>
> The problem withthe buildbot showing a compiler warning exists and we
> should fix it somehow.

The warning is bogus, and current compilers don't seem to emit it.  If
you can remove the warning by improving the code (or at least not making
it worse), then go right ahead anyway.



reply via email to

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