From 6e30181b4a3ab6c56da0378b65f4d60504982300 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Mon, 20 Dec 2021 15:00:24 -0800 Subject: math: Properly cast X_TLOSS to float [BZ #28713] Add #define AS_FLOAT_CONSTANT_1(x) x##f #define AS_FLOAT_CONSTANT(x) AS_FLOAT_CONSTANT_1(x) to cast X_TLOSS to float at compile-time to fix: FAIL: math/test-float-j0 FAIL: math/test-float-jn FAIL: math/test-float-y0 FAIL: math/test-float-y1 FAIL: math/test-float-yn FAIL: math/test-float32-j0 FAIL: math/test-float32-jn FAIL: math/test-float32-y0 FAIL: math/test-float32-y1 FAIL: math/test-float32-yn when compiling with GCC 12. Reviewed-by: Paul Zimmermann --- math/math-svid-compat.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'math/math-svid-compat.h') diff --git a/math/math-svid-compat.h b/math/math-svid-compat.h index 5c18cb1..876cadd 100644 --- a/math/math-svid-compat.h +++ b/math/math-svid-compat.h @@ -49,6 +49,8 @@ extern int matherr (struct exception *__exc); extern int __matherr (struct exception *__exc); #define X_TLOSS 1.41484755040568800000e+16 +#define AS_FLOAT_CONSTANT_1(x) x##f +#define AS_FLOAT_CONSTANT(x) AS_FLOAT_CONSTANT_1(x) /* Types of exceptions in the `type' field. */ #define DOMAIN 1 -- cgit v1.1