diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2005-06-16 19:14:01 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2005-06-16 19:14:01 +0000 |
commit | 68cdbb18dac8d6cc6990e1de7b4f481ccbbfcd1d (patch) | |
tree | ccc8d604adc3c53e70af476efb86f09ec70bb428 /newlib/libc/stdio/vfprintf.c | |
parent | ec3b136a64f8adaa39f454acefb106952a6139f5 (diff) | |
download | cygnal-68cdbb18dac8d6cc6990e1de7b4f481ccbbfcd1d.tar.gz cygnal-68cdbb18dac8d6cc6990e1de7b4f481ccbbfcd1d.tar.bz2 cygnal-68cdbb18dac8d6cc6990e1de7b4f481ccbbfcd1d.zip |
2005-06-16 Christopher Faylor <cgf@timesys.com>
* libc/stdio/vfprintf.c (cvt): Don't rely on pointer aliasing to
determine characteristics of long double. Use a union instead.
* ldtoa.c (_ldtoa_r): Ditto.
(_ldcheck): Ditto.
(_strtold): Ditto.
(union uconv): New union.
Diffstat (limited to 'newlib/libc/stdio/vfprintf.c')
-rw-r--r-- | newlib/libc/stdio/vfprintf.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c index c10fed8e9..c51b6b821 100644 --- a/newlib/libc/stdio/vfprintf.c +++ b/newlib/libc/stdio/vfprintf.c @@ -1260,7 +1260,11 @@ _DEFUN(cvt, (data, value, ndigits, flags, sign, decpt, ch, length), #ifdef _NO_LONGDBL union double_union tmp; #else - struct ldieee *ldptr; + union + { + struct ldieee ieee; + _LONG_DOUBLE val; + } ld; #endif if (ch == 'f') { @@ -1287,8 +1291,8 @@ _DEFUN(cvt, (data, value, ndigits, flags, sign, decpt, ch, length), digits = _dtoa_r (data, value, mode, ndigits, decpt, &dsgn, &rve); #else /* !_NO_LONGDBL */ - ldptr = (struct ldieee *)&value; - if (ldptr->sign) { /* this will check for < 0 and -0.0 */ + ld.val = value; + if (ld.ieee.sign) { /* this will check for < 0 and -0.0 */ value = -value; *sign = '-'; } else |