From f68fcd95d34d2f2ac286b9ebb64e3a07e36a20cf Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 5 Jan 2017 23:15:47 +0000 Subject: Make fallback fesetexceptflag always succeed (bug 21028). The fallback implementation of fesetexceptflag currently fails if any exceptions are specified. It should always succeed, because the exception state is always that all exceptions (if any are defined in but not supported in this configuration) are always clear, just as fallback fetestexcept always succeeds and fallback fesetenv always succeeds unless asked to set FE_NOMASK_ENV. This patch fixes it accordingly. Together with the patch to test-fexcept.c to allow feraiseexcept to fail in another place, this stops that test from failing for MIPS soft-float. Tested for mips64 soft-float. [BZ #21028] * math/fsetexcptflg.c (__fesetexceptflag): Always return 0. * math/test-fexcept.c (test_set): Allow failure of feraiseexcept if EXCEPTION_TESTS returns false. --- math/fsetexcptflg.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'math/fsetexcptflg.c') diff --git a/math/fsetexcptflg.c b/math/fsetexcptflg.c index 2e8237ee32..e79095b04e 100644 --- a/math/fsetexcptflg.c +++ b/math/fsetexcptflg.c @@ -23,8 +23,9 @@ int __fesetexceptflag (const fexcept_t *flagp, int excepts) { - /* This always fails unless nothing needs to be done. */ - return (excepts != 0); + /* This always succeeds, as all exceptions are always clear + (including in the saved state) so nothing needs to be done. */ + return 0; } #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) strong_alias (__fesetexceptflag, __old_fesetexceptflag) -- cgit v1.2.3