printf for denormalized double in newlib-1.8.1

joel@OARcorp.com joel@OARcorp.com
Thu May 13 08:35:00 GMT 1999


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
> 



More information about the Newlib mailing list