printf for denormalized double in newlib-1.8.1

Jay Kulpinski jskulpin@eng01.gdds.com
Thu May 13 07:10:00 GMT 1999


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