[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3] tests/qht-bench: Fix Clang 'implicit-int-float-conversion
From: |
Emilio G. Cota |
Subject: |
Re: [PATCH v3] tests/qht-bench: Fix Clang 'implicit-int-float-conversion' warning |
Date: |
Thu, 7 May 2020 00:54:13 -0400 |
On Mon, May 04, 2020 at 16:43:52 +0200, Philippe Mathieu-Daudé wrote:
> When building with Clang 10 on Fedora 32, we get:
>
> tests/qht-bench.c:287:29: error: implicit conversion from 'unsigned long'
> to 'double' changes value from 18446744073709551615 to 18446744073709551616
> [-Werror,-Wimplicit-int-float-conversion]
(snip)
> @@ -284,7 +285,7 @@ static void do_threshold(double rate, uint64_t *threshold)
> if (rate == 1.0) {
> *threshold = UINT64_MAX;
> } else {
> - *threshold = rate * UINT64_MAX;
> + *threshold = rate * nextafter(0x1p64, 0.0);
Reviewed-by: Emilio G. Cota <address@hidden>
Please consider mentioning 25f74087c69 in the commit log -- it clearly
describes the problem.
Thanks,
Emilio