diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2022-03-24 11:08:44 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-02-09 10:29:18 -0300 |
commit | 8135781ced0959951eacde8d5ab184fafb46ca6a (patch) | |
tree | 2b2527809e233bcbdfa82af6e1ca1d0c2be6b3aa | |
parent | 9491140bd7c32a24e8620d4b00fe42537eb23338 (diff) | |
download | glibc-8135781ced0959951eacde8d5ab184fafb46ca6a.tar glibc-8135781ced0959951eacde8d5ab184fafb46ca6a.tar.gz glibc-8135781ced0959951eacde8d5ab184fafb46ca6a.tar.bz2 glibc-8135781ced0959951eacde8d5ab184fafb46ca6a.zip |
math: Fix clang warnings on bug-tgmath1.c
The type generic fabs expansion issues the floating point absolute with
the wrong argument type (for instance cabs with floating point or fabs
with a complex type) and clang warns that implicit conversion might
incur in unexpected behavior.
-rw-r--r-- | math/bug-tgmath1.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/math/bug-tgmath1.c b/math/bug-tgmath1.c index 16db9d17a1..1c97df0a40 100644 --- a/math/bug-tgmath1.c +++ b/math/bug-tgmath1.c @@ -1,5 +1,6 @@ #include <stdio.h> #include <tgmath.h> +#include <libc-diag.h> int @@ -29,6 +30,12 @@ main (void) TEST (cimag (1.0f), sizeof (float)); TEST (cimag (1.0f + 1.0fi), sizeof (float)); + /* The type generic fabs expansion issues the floating point absolute with + the wrong argument type (for instance cabs with floating point or fabs + with a complex type) and clang warns that implicit conversion might + incur in unexpected behavior. */ + DIAG_PUSH_NEEDS_COMMENT_CLANG; + DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); TEST (fabs (1.0), sizeof (double)); TEST (fabs (1.0 + 1.0i), sizeof (double)); TEST (fabs (1.0l), sizeof (long double)); |