summaryrefslogtreecommitdiffstats
path: root/lib/libc/gdtoa/_ldtoa.c
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>2007-11-21 01:10:42 +0000
committerjb <jb@FreeBSD.org>2007-11-21 01:10:42 +0000
commitdb332cba551507129323c839351afcb5f28060d5 (patch)
tree78186ff4f00e1d1203b59235e02a1930d2606a28 /lib/libc/gdtoa/_ldtoa.c
parent97f8fd20a056a7deb6bbcae677fa9076bb48a19e (diff)
downloadFreeBSD-src-db332cba551507129323c839351afcb5f28060d5.zip
FreeBSD-src-db332cba551507129323c839351afcb5f28060d5.tar.gz
Use an intermediate pointer to avoid a strict aliasing warning.
Note that ULong in this code is actually defined as an unsigned integer across all arches so that the gdtoa() function always processes 32 bit data despite the unfortunate naming of "ULong".
Diffstat (limited to 'lib/libc/gdtoa/_ldtoa.c')
-rw-r--r--lib/libc/gdtoa/_ldtoa.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/gdtoa/_ldtoa.c b/lib/libc/gdtoa/_ldtoa.c
index 750a252..10731c4 100644
--- a/lib/libc/gdtoa/_ldtoa.c
+++ b/lib/libc/gdtoa/_ldtoa.c
@@ -61,6 +61,7 @@ __ldtoa(long double *ld, int mode, int ndigits, int *decpt, int *sign,
char *ret;
union IEEEl2bits u;
uint32_t bits[(LDBL_MANT_DIG + 31) / 32];
+ void *vbits = bits;
u.e = *ld;
*sign = u.bits.sign;
@@ -93,7 +94,7 @@ __ldtoa(long double *ld, int mode, int ndigits, int *decpt, int *sign,
abort();
}
- ret = gdtoa(&fpi, be, (ULong *)bits, &kind, mode, ndigits, decpt, rve);
+ ret = gdtoa(&fpi, be, vbits, &kind, mode, ndigits, decpt, rve);
if (*decpt == -32768)
*decpt = INT_MAX;
return ret;
OpenPOWER on IntegriCloud