about summary refs log tree commit diff
path: root/benchtests/bench-malloc-thread.c
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-02-06 16:52:17 -0300
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2024-04-17 16:12:41 -0300
commit6677c619032b1b284e40ca752c0338e8f10b6d94 (patch)
tree8b664668077253b1e6600f3cef536363c0048c31 /benchtests/bench-malloc-thread.c
parent230d65fc7342d98816799b46ecb92b35d33f922c (diff)
downloadglibc-6677c619032b1b284e40ca752c0338e8f10b6d94.tar.gz
glibc-6677c619032b1b284e40ca752c0338e8f10b6d94.tar.xz
glibc-6677c619032b1b284e40ca752c0338e8f10b6d94.zip
benchtests: Remove clang warnings
clangs warns of the implicit cast of RAND_MAX to float:

  error: implicit conversion from 'int' to 'float' changes value from
  2147483647 to 2147483648 [-Werror,-Wimplicit-const-int-float-conversion]

So make it explicit.
Diffstat (limited to 'benchtests/bench-malloc-thread.c')
-rw-r--r--benchtests/bench-malloc-thread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/benchtests/bench-malloc-thread.c b/benchtests/bench-malloc-thread.c
index 46fdabd30c..74e71ec9ce 100644
--- a/benchtests/bench-malloc-thread.c
+++ b/benchtests/bench-malloc-thread.c
@@ -63,7 +63,7 @@ get_block_size (unsigned int rand_data)
   float min_pow = powf (dist_min, exponent + 1);
   float max_pow = powf (dist_max, exponent + 1);
 
-  float r = (float) rand_data / RAND_MAX;
+  float r = (float) rand_data / (float) RAND_MAX;
 
   return (unsigned int) powf ((max_pow - min_pow) * r + min_pow,
 			      1 / (exponent + 1));