Fix fallback fesetenv and feupdateenv on FE_NOMASK_ENV
Commit Message
This patch fixes bug 17088, fallback fesetenv and feupdateenv not
giving an error for an FE_NOMASK_ENV argument when it requires traps
to be enabled. (This is the bug tested for by test-fenv-return.c.)
Tested mips64 soft-float.
2014-06-25 Joseph Myers <joseph@codesourcery.com>
[BZ #17088]
* math/fesetenv.c (__fesetenv)
[FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Return 1 for FE_NOMASK_ENV.
* math/feupdateenv.c (__feupdateenv)
[FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Likewise.
Comments
Ping (last ping for this patch for 2.20). This patch
<https://sourceware.org/ml/libc-alpha/2014-06/msg00777.html> is pending
review.
Ping^2. This patch
<https://sourceware.org/ml/libc-alpha/2014-06/msg00777.html> is still
pending review.
On 06/25/2014 07:29 PM, Joseph S. Myers wrote:
> This patch fixes bug 17088, fallback fesetenv and feupdateenv not
> giving an error for an FE_NOMASK_ENV argument when it requires traps
> to be enabled. (This is the bug tested for by test-fenv-return.c.)
Ok, thanks,
Andreas
@@ -23,6 +23,10 @@
int
__fesetenv (const fenv_t *envp)
{
+#if defined FE_NOMASK_ENV && FE_ALL_EXCEPT != 0
+ if (envp == FE_NOMASK_ENV)
+ return 1;
+#endif
/* Nothing to do. */
return 0;
}
@@ -23,6 +23,10 @@
int
__feupdateenv (const fenv_t *envp)
{
+#if defined FE_NOMASK_ENV && FE_ALL_EXCEPT != 0
+ if (envp == FE_NOMASK_ENV)
+ return 1;
+#endif
/* Nothing to do. */
return 0;
}