This is the mail archive of the
newlib@sourceware.cygnus.com
mailing list for the newlib project.
Re: printf for denormalized double in newlib-1.8.1
- To: Jay Kulpinski <jskulpin@eng01.gdds.com>
- Subject: Re: printf for denormalized double in newlib-1.8.1
- From: joel@OARcorp.com
- Date: Thu, 13 May 1999 10:42:34 -0500 (CDT)
- cc: newlib@cygnus.com, rtems-snapshots@OARcorp.com
I have put this in the newlib tree I maintain for RTEMS with the following
ChangeLog entry:
Thu May 13 11:11:26 CDT 1999 Jay Kulpinski <jskulpin@eng01.gdds.com>
* libc/stdlib/mprec.c: Fixed unitialized variable problem.
Thanks.
On Thu, 13 May 1999, Jay Kulpinski wrote:
> 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
>