* lib/hash.c (compute_bucket_size): Cast SIZE_MAX to float
to avoid this warning from clang-10 (for use in grep):
hash.c:501:11: error: implicit conversion from 'unsigned long' \
to 'float' changes value from
18446744073709551615 to \
18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
if (SIZE_MAX <= new_candidate)
(hash_insert_if_absent): Likewise.
+2020-12-29 Jim Meyering <meyering@fb.com>
+
+ hash: add casts-to-float to avoid clang-10 warnings
+ * lib/hash.c (compute_bucket_size): Cast SIZE_MAX to float
+ to avoid this warning from clang-10 (for use in grep):
+ hash.c:501:11: error: implicit conversion from 'unsigned long' \
+ to 'float' changes value from 18446744073709551615 to \
+ 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
+ if (SIZE_MAX <= new_candidate)
+ (hash_insert_if_absent): Likewise.
+
2020-12-29 Paul Eggert <eggert@cs.ucla.edu>
canonicalize: fix size overflow treatment
if (!tuning->is_n_buckets)
{
float new_candidate = candidate / tuning->growth_threshold;
- if (SIZE_MAX <= new_candidate)
+ if ((float) SIZE_MAX <= new_candidate)
return 0;
candidate = new_candidate;
}
: (table->n_buckets * tuning->growth_factor
* tuning->growth_threshold));
- if (SIZE_MAX <= candidate)
+ if ((float) SIZE_MAX <= candidate)
return -1;
/* If the rehash fails, arrange to return NULL. */