Fix fenv.h fallback returns (bug 14027).
authorJoseph Myers <joseph@codesourcery.com>
Fri, 27 Apr 2012 13:54:09 +0000 (13:54 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 27 Apr 2012 13:54:09 +0000 (13:54 +0000)
ChangeLog
NEWS
math/fclrexcpt.c
math/fraiseexcpt.c
math/fsetexcptflg.c

index 50c27f7fda1752beac6c6f33363d68039b38fd7a..2035e58f35bebdb328c9edd20c3f01175e3cfd30 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-04-27  Joseph Myers  <joseph@codesourcery.com>
+
+       [BZ #14027]
+       * math/fclrexcpt.c (__feclearexcept): Return zero if nothing needs
+       to be done.
+       * math/fraiseexcpt.c (__feraiseexcept): Likewise.
+       * math/fsetexcptflg.c (__fesetexceptflag): Likewise.
+
 2012-04-26  Joseph Myers  <joseph@codesourcery.com>
 
        * sysdeps/unix/i386/brk.S: Remove file.
diff --git a/NEWS b/NEWS
index 00620ff42caee4c331af246c8e7e71825c458cc0..cd523640c0f90baca3580ecc0755bea461886eef 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -22,7 +22,7 @@ Version 2.16
   13846, 13851, 13852, 13854, 13871, 13872, 13873, 13879, 13883, 13886,
   13892, 13895, 13908, 13910, 13911, 13912, 13913, 13915, 13916, 13917,
   13918, 13919, 13920, 13921, 13926, 13927, 13928, 13938, 13963, 13967,
-  13970, 13973
+  13970, 13973, 14027
 
 * ISO C11 support:
 
index 27e9bd0c32c6124fc23b936678eb159f50308144..dcdcfbbe997cf6bfbf6abbe8eb393a51a1fb329e 100644 (file)
@@ -1,5 +1,5 @@
 /* Clear given exceptions in current floating-point environment.
-   Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -23,8 +23,8 @@
 int
 __feclearexcept (int excepts)
 {
-  /* This always fails.  */
-  return 1;
+  /* This always fails unless nothing needs to be done.  */
+  return (excepts != 0);
 }
 #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__feclearexcept, __old_feclearexcept)
index cb752df7346f93aa28bd62ac74dce9b22fdf64e5..83a488b45676be5991840880aa499bb13ba83643 100644 (file)
@@ -1,5 +1,5 @@
 /* Raise given exceptions.
-   Copyright (C) 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -23,8 +23,8 @@
 int
 __feraiseexcept (int excepts)
 {
-  /* This always fails.  */
-  return 1;
+  /* This always fails unless nothing needs to be done.  */
+  return (excepts != 0);
 }
 #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__feraiseexcept, __old_feraiseexcept)
index 3f6ac9893ba57bc757dc8a8bbd645997b1a25180..7d27d7f22600b989afa3d0c3971878bb9cb3c08b 100644 (file)
@@ -1,5 +1,5 @@
 /* Set floating-point environment exception handling.
-   Copyright (C) 1997, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1997-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -23,8 +23,8 @@
 int
 __fesetexceptflag (const fexcept_t *flagp, int excepts)
 {
-  /* This always fails.  */
-  return 1;
+  /* This always fails unless nothing needs to be done.  */
+  return (excepts != 0);
 }
 #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
 strong_alias (__fesetexceptflag, __old_fesetexceptflag)