diff mbox

Mark fegetround pure (bug 16296)

Message ID alpine.DEB.2.10.1509152037260.16292@digraph.polyomino.org.uk
State New
Headers show

Commit Message

Joseph Myers Sept. 15, 2015, 8:37 p.m. UTC
Bug 16296 notes that fegetround is a pure function and should be
marked as such in fenv.h.  This patch implements that.

Tested for x86_64 and x86 (testsuite, and that installed stripped
shared libraries are unchanged by this patch).

2015-09-15  Joseph Myers  <joseph@codesourcery.com>

	[BZ #16296]
	* math/fenv.h (fegetround): Use __attribute_pure__.
	* include/fenv.h (__fegetround): Likewise.
diff mbox

Patch

diff --git a/include/fenv.h b/include/fenv.h
index 7070199..de4d46f 100644
--- a/include/fenv.h
+++ b/include/fenv.h
@@ -13,7 +13,7 @@  extern int __fesetexceptflag (const fexcept_t *__flagp, int __excepts);
 extern int __fegetenv (fenv_t *__envp);
 extern int __fesetenv (const fenv_t *__envp);
 extern int __feupdateenv (const fenv_t *__envp);
-extern __typeof (fegetround) __fegetround;
+extern __typeof (fegetround) __fegetround __attribute_pure__;
 extern __typeof (feholdexcept) __feholdexcept;
 extern __typeof (fesetround) __fesetround;
 
diff --git a/math/fenv.h b/math/fenv.h
index b80d3c0..9d4492f 100644
--- a/math/fenv.h
+++ b/math/fenv.h
@@ -82,7 +82,7 @@  extern int fetestexcept (int __excepts) __THROW;
 /* Rounding control.  */
 
 /* Get current rounding direction.  */
-extern int fegetround (void) __THROW;
+extern int fegetround (void) __THROW __attribute_pure__;
 
 /* Establish the rounding direction represented by ROUND.  */
 extern int fesetround (int __rounding_direction) __THROW;