[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/2] migration: Fix incorrect integer->float conversion ca
From: |
Markus Armbruster |
Subject: |
Re: [PATCH v3 1/2] migration: Fix incorrect integer->float conversion caught by clang |
Date: |
Tue, 14 Jan 2020 11:00:14 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Markus Armbruster <address@hidden> writes:
> Juan Quintela <address@hidden> writes:
>
>> Markus Armbruster <address@hidden> wrote:
>>> From: Fangrui Song <address@hidden>
>>>
>>> Clang does not like qmp_migrate_set_downtime()'s code to clamp double
>>> @value to 0..INT64_MAX:
>>>
>>> qemu/migration/migration.c:2038:24: error: implicit conversion from
>>> 'long' to 'double' changes value from 9223372036854775807 to
>>> 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
>>>
>>> The warning will be enabled by default in clang 10. It is not
>>> available for clang <= 9.
>>>
>>> The clamp is actually useless; @value is checked to be within
>>> 0..MAX_MIGRATE_DOWNTIME_SECONDS immediately before. Delete it.
>>>
>>> While there, make the conversion from double to int64_t explicit.
>>>
>>> Signed-off-by: Fangrui Song <address@hidden>
>>> Reviewed-by: Markus Armbruster <address@hidden>
>>> [Patch split, commit message improved]
>>> Signed-off-by: Markus Armbruster <address@hidden>
>>
>> Reviewed-by: Juan Quintela <address@hidden>
>>
>> Should I get this through migration tree, or are you going to pull it?
>
> Plase take this patch through the migration tree.
Ping...
- Re: [PATCH v3 1/2] migration: Fix incorrect integer->float conversion caught by clang,
Markus Armbruster <=