public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* Fix types of FE_DFL_ENV and FE_NOMASK_ENV (bug 14805)
@ 2012-11-05 13:41 Joseph S. Myers
  0 siblings, 0 replies; only message in thread
From: Joseph S. Myers @ 2012-11-05 13:41 UTC (permalink / raw)
  To: libc-alpha; +Cc: libc-ports

Bug 14805 is the use of casts to (fenv_t *) instead of the correct (const 
fenv_t *) in FE_DFL_ENV on some architectures, and in one case in 
FE_NOMASK_ENV as well.  I've committed this patch as obvious to fix those 
architectures to match other architectures and ISO C.

diff --git a/ChangeLog b/ChangeLog
index fdd4a5a..3ff6937 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2012-11-05  Joseph Myers  <joseph@codesourcery.com>
 
+	[BZ #14805]
+	* sysdeps/sh/sh4/fpu/bits/fenv.h (FE_DFL_ENV): Use cast to const
+	fenv_t *.
+
 	[BZ #14801]
 	* sysdeps/s390/fpu/bits/fenv.h (fenv_t): Use implementation
 	namespace for names of struct fields.
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 234883e..c0e9ac2 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,3 +1,8 @@
+2012-11-05  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #14805]
+	* sysdeps/arm/bits/fenv.h (FE_DFL_ENV): Use cast to const fenv_t *.
+
 2012-11-03  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/arm/fclrexcpt.c (feclearexcept): Add libm_hidden_ver.
diff --git a/ports/ChangeLog.hppa b/ports/ChangeLog.hppa
index 3e8d522..201dd01 100644
--- a/ports/ChangeLog.hppa
+++ b/ports/ChangeLog.hppa
@@ -1,3 +1,10 @@
+2012-11-05  Joseph Myers  <joseph@codesourcery.com>
+
+	[BZ #14805]
+	* sysdeps/hppa/fpu/bits/fenv.h (FE_DFL_ENV): Use cast to const
+	fenv_t *.
+	(FE_NOMASK_ENV): Likewise.
+
 2012-11-03  Joseph Myers  <joseph@codesourcery.com>
 
 	* sysdeps/hppa/fpu/fclrexcpt.c (feclearexcept): Add
diff --git a/ports/sysdeps/arm/bits/fenv.h b/ports/sysdeps/arm/bits/fenv.h
index 6788e28..bc4a3ee 100644
--- a/ports/sysdeps/arm/bits/fenv.h
+++ b/ports/sysdeps/arm/bits/fenv.h
@@ -74,7 +74,7 @@ typedef struct
 fenv_t;
 
 /* If the default argument is used we use this value.  */
-#define FE_DFL_ENV	((fenv_t *) -1l)
+#define FE_DFL_ENV	((const fenv_t *) -1l)
 
 #ifdef __USE_GNU
 /* Floating-point environment where none of the exceptions are masked.  */
diff --git a/ports/sysdeps/hppa/fpu/bits/fenv.h b/ports/sysdeps/hppa/fpu/bits/fenv.h
index 0618b1b..49e3018 100644
--- a/ports/sysdeps/hppa/fpu/bits/fenv.h
+++ b/ports/sysdeps/hppa/fpu/bits/fenv.h
@@ -83,9 +83,9 @@ typedef struct
 } fenv_t;
 
 /* If the default argument is used we use this value.  */
-#define FE_DFL_ENV ((fenv_t *) -1)
+#define FE_DFL_ENV ((const fenv_t *) -1)
 
 #ifdef __USE_GNU
 /* Floating-point environment where none of the exceptions are masked.  */
-# define FE_NOMASK_ENV	((fenv_t *) -2)
+# define FE_NOMASK_ENV	((const fenv_t *) -2)
 #endif
diff --git a/sysdeps/sh/sh4/fpu/bits/fenv.h b/sysdeps/sh/sh4/fpu/bits/fenv.h
index e51a057..a29edfc 100644
--- a/sysdeps/sh/sh4/fpu/bits/fenv.h
+++ b/sysdeps/sh/sh4/fpu/bits/fenv.h
@@ -73,4 +73,4 @@ typedef struct
 fenv_t;
 
 /* If the default argument is used we use this value.  */
-#define FE_DFL_ENV	((fenv_t *) -1)
+#define FE_DFL_ENV	((const fenv_t *) -1)

-- 
Joseph S. Myers
joseph@codesourcery.com

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-11-05 13:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-05 13:41 Fix types of FE_DFL_ENV and FE_NOMASK_ENV (bug 14805) Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).