This is the mail archive of the
newlib@sourceware.cygnus.com
mailing list for the newlib project.
printf for denormalized double in newlib-1.8.1
- To: newlib@cygnus.com, rtems-snapshots@oarcorp.com, joel@oarcorp.com
- Subject: printf for denormalized double in newlib-1.8.1
- From: Jay Kulpinski <jskulpin@eng01.gdds.com>
- Date: Thu, 13 May 1999 10:08:18 -0400
When running the paranoia.exe test from RTEMS under psim, problems occur
when it tries to print the smallest positive double. The d2b() function
operates on an uninitialized value and returns an invalid value which
later causes the automatic variables to be overwritten by a too-long
string, taking out the whole program.
(616)% diff -c newlib-1.8.1/newlib/libc/stdlib/mprec.c{-orig,}
*** newlib-1.8.1/newlib/libc/stdlib/mprec.c-orig Wed May 12
11:43:46 1999
--- newlib-1.8.1/newlib/libc/stdlib/mprec.c Wed May 12 11:45:08 1999
***************
*** 763,769 ****
--- 763,771 ----
unsigned long *x, y, z;
#ifdef VAX
unsigned long d0, d1;
+ #endif
d.d = _d;
+ #ifdef VAX
d0 = word0 (d) >> 16 | word0 (d) << 16;
d1 = word1 (d) >> 16 | word1 (d) << 16;
#else