Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2005-06-16 23:14:01 +0400
committerJeff Johnston <jjohnstn@redhat.com>2005-06-16 23:14:01 +0400
commit68cdbb18dac8d6cc6990e1de7b4f481ccbbfcd1d (patch)
treeccc8d604adc3c53e70af476efb86f09ec70bb428 /newlib/libc/stdio/vfprintf.c
parentec3b136a64f8adaa39f454acefb106952a6139f5 (diff)
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.c10
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