[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] iotest 013 failure under clang -fsanitize=
Re: [Qemu-block] [Qemu-devel] iotest 013 failure under clang -fsanitize=undefined
Tue, 2 Feb 2016 14:59:18 -0700
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0
On 02/02/2016 01:03 PM, John Snow wrote:
> The problem is that in the print report for read_f, t2 and t1 can
> actually be the same exact timestamp, and tdiv will try to divide by 0.0.
> Normally this is not a problem as this is defined to be INFINITY in C99
> Annex F.
> Clang, however, has once again decided to take the pedantic road and
> state that Annex F is optional, and therefore division by 0.0 is
> actually undefined when using -fsanitize=undefined.
No kidding. :(
A compiler ceases to be useful when it spews out noise "just because it
> Two workarounds:
> (1) Modify the tdiv() function to just return INFINITY manually if the
> timestamp provided is 0
Seems reasonable to me.
I'd be okay with this patch, if you want to make it a formal submission,
and if no one else chimes in with any opinion other than disgust at
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Description: OpenPGP digital signature