diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-01-04 10:29:09 -0300 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2024-04-17 16:12:41 -0300 |
commit | 1b803c315f36042a3e6191692eca40800210aa16 (patch) | |
tree | f2a7b53842715edea32e8f0f8aede5a938b78a5d /math/test-fexcept-traps.c | |
parent | 3a8f2d8706711b287267bff14e20de251d93a1b6 (diff) | |
download | glibc-1b803c315f36042a3e6191692eca40800210aa16.tar.gz glibc-1b803c315f36042a3e6191692eca40800210aa16.tar.xz glibc-1b803c315f36042a3e6191692eca40800210aa16.zip |
math: Remove _Static_assert that uses EXCEPTION_SET_FORCES_TRAP
And make them a runtime check with assert since EXCEPTION_SET_FORCES_TRAP might not be an integral constant expression (i.e on i386).
Diffstat (limited to 'math/test-fexcept-traps.c')
-rw-r--r-- | math/test-fexcept-traps.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/math/test-fexcept-traps.c b/math/test-fexcept-traps.c index 0f5802c773..83053b074d 100644 --- a/math/test-fexcept-traps.c +++ b/math/test-fexcept-traps.c @@ -70,9 +70,13 @@ do_test (void) Also check if the function does not alter the exception mask. */ ret = fesetexceptflag (&saved, FE_ALL_EXCEPT); - _Static_assert (!(EXCEPTION_SET_FORCES_TRAP && !EXCEPTION_TESTS(float)), - "EXCEPTION_SET_FORCES_TRAP only makes sense if the " - "architecture suports exceptions"); + if (EXCEPTION_SET_FORCES_TRAP && !EXCEPTION_TESTS(float)) + { + puts ("EXCEPTION_SET_FORCES_TRAP only makes sense if the architecture " + "suports exceptions"); + return 77; + } + { int exc_before = fegetexcept (); ret = fesetexceptflag (&saved, FE_ALL_EXCEPT); |