public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-10-04 12:58 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 12:58 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b8cf18454951fe479a38638d3041f5cec0c5f2f8

commit b8cf18454951fe479a38638d3041f5cec0c5f2f8
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2024-04-17 20:06 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2024-04-17 20:06 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7cfc8eda54c039472d21baee7cddfbbb8e695612

commit 7cfc8eda54c039472d21baee7cddfbbb8e695612
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 5539a0a6e7..b39637c2bd 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2024-04-02 15:52 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2024-04-02 15:52 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=06219c90a2d7636195d33ce5a2293752eaecdfd8

commit 06219c90a2d7636195d33ce5a2293752eaecdfd8
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 5539a0a6e7..b39637c2bd 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2024-02-09 17:30 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2024-02-09 17:30 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ed730642001839642ba7065f02e93e514232b113

commit ed730642001839642ba7065f02e93e514232b113
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 5539a0a6e7..b39637c2bd 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2024-02-07 14:05 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2024-02-07 14:05 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b1ab64f0fbbdb6df4ddc83147ba17709f8b76c01

commit b1ab64f0fbbdb6df4ddc83147ba17709f8b76c01
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 5539a0a6e7..b39637c2bd 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2024-01-29 17:56 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2024-01-29 17:56 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=84b81bed2566c17694bf9296ab3ae4327b59e4b6

commit 84b81bed2566c17694bf9296ab3ae4327b59e4b6
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 5539a0a6e7..b39637c2bd 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2023-12-21 18:52 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2023-12-21 18:52 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6f78a71f54c8ebd90a0794d4d7809962b699df9c

commit 6f78a71f54c8ebd90a0794d4d7809962b699df9c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 99c2105952..aafa1f581e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2023-09-28 17:50 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2023-09-28 17:50 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=aea078e54582238ca091da7d02cbd155280cb6c7

commit aea078e54582238ca091da7d02cbd155280cb6c7
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 99c2105952..aafa1f581e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2023-08-30 12:35 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2023-08-30 12:35 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8317bd6939613b1a3d4347940276fe0a77410ced

commit 8317bd6939613b1a3d4347940276fe0a77410ced
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 99c2105952..aafa1f581e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2023-02-09 19:47 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:47 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=8dac8b892a2d74907bc89ab13705676d6c989571

commit 8dac8b892a2d74907bc89ab13705676d6c989571
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index 99c2105952..aafa1f581e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-10-28 17:40 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:40 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4685f533a2c76640ca6e96f0b3c60fea1ad94efc

commit 4685f533a2c76640ca6e96f0b3c60fea1ad94efc
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow
    
    Clang warns:
    
      ../sysdeps/x86/fpu/powl_helper.c:233:3: error: absolute value function
      '__builtin_fabsf' given an argument of type 'typeof (res)' (aka 'long
      double') but has parameter of type 'float' which may cause truncation of
      value [-Werror,-Wabsolute-value]
        math_check_force_underflow (res);
        ^
      ./math-underflow.h:45:11: note: expanded from macro
      'math_check_force_underflow'
            if (fabs_tg (force_underflow_tmp)                         \
                ^
      ./math-underflow.h:27:20: note: expanded from macro 'fabs_tg'
      #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
                         ^
      ../math/math.h:899:16: note: expanded from macro '__MATH_TG'
                     float: FUNC ## f ARGS,           \
                            ^
      <scratch space>:73:1: note: expanded from here
      __builtin_fabsf
      ^

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */

^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-06-09 21:19 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:19 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ef4eb6aa79997f7c26685710559c8fd4d357be82

commit ef4eb6aa79997f7c26685710559c8fd4d357be82
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-06-09 13:15 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:15 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ef4eb6aa79997f7c26685710559c8fd4d357be82

commit ef4eb6aa79997f7c26685710559c8fd4d357be82
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-06-03 14:05 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:05 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=91f5525055d02e6205ffc50d162c34e4e708a2d0

commit 91f5525055d02e6205ffc50d162c34e4e708a2d0
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-05-13 14:19 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:19 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=4b396c21ead627991012eefbf3b6d03710b2f1ec

commit 4b396c21ead627991012eefbf3b6d03710b2f1ec
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-05-12 19:32 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:32 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=92ccd60891e022f59f32833e311f343119a9ade1

commit 92ccd60891e022f59f32833e311f343119a9ade1
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-05-10 18:23 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:23 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=bfa9547a913cd39aadc72a119d1b133d14692c4c

commit bfa9547a913cd39aadc72a119d1b133d14692c4c
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-04-29 14:03 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:03 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c31df112c52188cf5c87d8a15389413c283e9c92

commit c31df112c52188cf5c87d8a15389413c283e9c92
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-04-04 12:53 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-04-04 12:53 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=6b5bb21d871e247517b46eb702915c3ae97473e2

commit 6b5bb21d871e247517b46eb702915c3ae97473e2
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-03-31 19:05 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-03-31 19:05 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=c84dce4d486a834c9f58879b1a7f03dac7d7f5a0

commit c84dce4d486a834c9f58879b1a7f03dac7d7f5a0
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-03-29 20:28 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-03-29 20:28 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=392b04f61235817fe1ed37ff5b7aaeeb916d1f50

commit 392b04f61235817fe1ed37ff5b7aaeeb916d1f50
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-03-16 18:02 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-03-16 18:02 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5d19f28522e8e43a8f9437e8da9e15176a1f2875

commit 5d19f28522e8e43a8f9437e8da9e15176a1f2875
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-03-15 18:40 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-03-15 18:40 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5d19f28522e8e43a8f9437e8da9e15176a1f2875

commit 5d19f28522e8e43a8f9437e8da9e15176a1f2875
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-03-11 17:24 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-03-11 17:24 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=706b04ddfafac006ea37bd9690ad011969037254

commit 706b04ddfafac006ea37bd9690ad011969037254
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

* [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow
@ 2022-03-10 19:23 Adhemerval Zanella
  0 siblings, 0 replies; 25+ messages in thread
From: Adhemerval Zanella @ 2022-03-10 19:23 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=19413abd374e7b576fa7c92e32a32a8dd75b1ad4

commit 19413abd374e7b576fa7c92e32a32a8dd75b1ad4
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 10 13:53:13 2022 -0300

    math: Suppress clang warning on math_check_force_underflow

Diff:
---
 math/math-underflow.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/math/math-underflow.h b/math/math-underflow.h
index c9d363ddd1..4bec3d349e 100644
--- a/math/math-underflow.h
+++ b/math/math-underflow.h
@@ -23,6 +23,7 @@
 #include <math.h>
 
 #include <math-barriers.h>
+#include <libc-diag.h>
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
@@ -37,10 +38,15 @@
 #define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
-   exception.  */
+   exception.
+
+   clang issues a warning where _Generic is using a non expected
+   builtin which may cause truncation of value.  */
 #define math_check_force_underflow(x)				\
   do								\
     {								\
+      DIAG_PUSH_NEEDS_COMMENT_CLANG;				\
+      DIAG_IGNORE_NEEDS_COMMENT_CLANG (13, "-Wabsolute-value"); \
       __typeof (x) force_underflow_tmp = (x);			\
       if (fabs_tg (force_underflow_tmp)				\
 	  < min_of_type (force_underflow_tmp))			\
@@ -49,6 +55,7 @@
 	    = force_underflow_tmp * force_underflow_tmp;	\
 	  math_force_eval (force_underflow_tmp2);		\
 	}							\
+      DIAG_POP_NEEDS_COMMENT_CLANG;				\
     }								\
   while (0)
 /* Likewise, but X is also known to be nonnegative.  */


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2024-04-17 20:06 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 12:58 [glibc/azanella/clang] math: Suppress clang warning on math_check_force_underflow Adhemerval Zanella
  -- strict thread matches above, loose matches on Subject: below --
2024-04-17 20:06 Adhemerval Zanella
2024-04-02 15:52 Adhemerval Zanella
2024-02-09 17:30 Adhemerval Zanella
2024-02-07 14:05 Adhemerval Zanella
2024-01-29 17:56 Adhemerval Zanella
2023-12-21 18:52 Adhemerval Zanella
2023-09-28 17:50 Adhemerval Zanella
2023-08-30 12:35 Adhemerval Zanella
2023-02-09 19:47 Adhemerval Zanella
2022-10-28 17:40 Adhemerval Zanella
2022-06-09 21:19 Adhemerval Zanella
2022-06-09 13:15 Adhemerval Zanella
2022-06-03 14:05 Adhemerval Zanella
2022-05-13 14:19 Adhemerval Zanella
2022-05-12 19:32 Adhemerval Zanella
2022-05-10 18:23 Adhemerval Zanella
2022-04-29 14:03 Adhemerval Zanella
2022-04-04 12:53 Adhemerval Zanella
2022-03-31 19:05 Adhemerval Zanella
2022-03-29 20:28 Adhemerval Zanella
2022-03-16 18:02 Adhemerval Zanella
2022-03-15 18:40 Adhemerval Zanella
2022-03-11 17:24 Adhemerval Zanella
2022-03-10 19:23 Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).