This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Mark fegetround pure (bug 16296)
- From: Joseph Myers <joseph at codesourcery dot com>
- To: <libc-alpha at sourceware dot org>
- Date: Tue, 15 Sep 2015 20:37:43 +0000
- Subject: Mark fegetround pure (bug 16296)
- Authentication-results: sourceware.org; auth=none
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 --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;
--
Joseph S. Myers
joseph@codesourcery.com