[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 1/1] utils: Use fixed-point arithmetic in qemu_strtosz
From: |
Eric Blake |
Subject: |
Re: [PATCH v2 1/1] utils: Use fixed-point arithmetic in qemu_strtosz |
Date: |
Wed, 17 Mar 2021 06:16:11 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 |
On 3/17/21 2:09 AM, Thomas Huth wrote:
> On 15/03/2021 16.58, Richard Henderson wrote:
>> Once we've parsed the fractional value, extract it into an integral
>> 64-bit fraction. Perform the scaling with integer arithemetic, and
>> simplify the overflow detection.
>
> I've put this patch in my local branch, but I'm still getting a failure
> in the cutils test, this time in the Cirrus-CI with the MinGW build:
>
> https://cirrus-ci.com/task/5413753530351616?command=test#L543
>
> Is it related or is this a different bug?
ERROR test-cutils - Bail out!
ERROR:../tests/unit/test-cutils.c:2233:test_qemu_strtosz_trailing:
assertion failed (res == 0): (1024 == 0)
That's testing behavior on:
str = "0x";
err = qemu_strtosz(str, &endptr, &res);
which should parse as "0" with a suffix of 'x'. It is an independent
issue (unrelated to the rounding issues fixed in rth's patch), and
rather appears to be a bug in mingw's libc for strtoull although I have
not actually set up an environment to test that assumption yet.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org