summaryrefslogtreecommitdiff
path: root/set_ld.c
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2009-08-26 08:48:37 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2009-08-26 08:48:37 +0000
commit8e03163767dc9971a3bcebbd36abb4fefb526815 (patch)
treee0421a45da38fdf64f50113acb5ff5b73b70e7de /set_ld.c
parentae225a5f36f45a8de0640edfb7d8f1b493efffb8 (diff)
downloadmpfr-8e03163767dc9971a3bcebbd36abb4fefb526815.tar.gz
set_ld.c: replaced a struct by a union. The struct was triggering the
following warning with GCC 4.4: dereferencing type-punned pointer will break strict-aliasing rules (possibly due to possible memory alignment problems). The old code looked strange anyway and unions are exactly for such kind of things. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6381 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'set_ld.c')
-rw-r--r--set_ld.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/set_ld.c b/set_ld.c
index f40dd8053..b08edc6d6 100644
--- a/set_ld.c
+++ b/set_ld.c
@@ -32,15 +32,15 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
has been seen with the problem, and gcc 2.95.4 on FreeBSD 4.7. */
#if HAVE_LDOUBLE_IEEE_EXT_LITTLE
-static const struct {
+static const union {
char bytes[10];
- long double dummy; /* for memory alignment */
+ long double d;
} ldbl_max_struct = {
{ '\377','\377','\377','\377',
'\377','\377','\377','\377',
- '\376','\177' }, 0.0
+ '\376','\177' }
};
-#define MPFR_LDBL_MAX (* (const long double *) ldbl_max_struct.bytes)
+#define MPFR_LDBL_MAX (ldbl_max_struct.d)
#else
#define MPFR_LDBL_MAX LDBL_MAX
#endif