1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-10-31 22:10:34 +03:00

math: Fix compare sort function on compoundn

To use the fabs function to the used type, instead of the double
variant.  it fixes a build issue with clang:

./s_compoundn_template.c:64:14: error: absolute value function 'fabs' given an argument of type 'const long double' but has parameter of type 'double' which may cause truncation of value [-Werror,-Wabsolute-value]
   64 |   FLOAT pd = fabs (*(const FLOAT *) p);
      |              ^
./s_compoundn_template.c:64:14: note: use function 'fabsl' instead
   64 |   FLOAT pd = fabs (*(const FLOAT *) p);
      |              ^~~~
      |              fabsl

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
This commit is contained in:
Adhemerval Zanella
2025-10-20 09:27:53 -03:00
parent ab22e5ec37
commit 0e4ca88bd2

View File

@@ -61,8 +61,8 @@ mul3_split (FLOAT *out, FLOAT a, FLOAT b, FLOAT c, FLOAT d)
static int static int
compare (const void *p, const void *q) compare (const void *p, const void *q)
{ {
FLOAT pd = fabs (*(const FLOAT *) p); FLOAT pd = M_FABS (*(const FLOAT *) p);
FLOAT qd = fabs (*(const FLOAT *) q); FLOAT qd = M_FABS (*(const FLOAT *) q);
if (pd < qd) if (pd < qd)
return -1; return -1;
else if (pd == qd) else if (pd == qd)