[comp.sys.mac.programmer] Yet another sscanf buf in Think 4.0?

russotto@eng.umd.edu (Matthew T. Russotto) (11/03/89)

Has anyone else seen the bug in the 68881 ANSI library that
causes the first two bytes after a float to be zeroed?
It does not occur in the standard library.
It is fully reproducable on my system with this program:

static float setme;
unsigned long getstrashed = 0xFFFFFFFF;
char mystr[] = "1.0";
main()
{
 printf("mystr %s, setme %f, getstrashed %08lX\n", mystr, setme, getstrashed);
 sscanf(mystr, "%f", &setme);
 printf("mystr %s, setme %f, getstrashed %08lX\n", mystr, setme, getstrashed);
}
Results with 68881 enabled, using ANSI-68881 library:
mystr 1.0, setme 0, getstrashed FFFFFFFF
mystr 1.0, setme 1, getstrashed 0000FFFF
Results with 68881 disabled, using ANSI library
mystr 1.0, setme 0, getstrashed FFFFFFFF
mystr 1.0, setme 1, getstrashed FFFFFFFF
(if this has been discussed before, I apologize)
--
Matthew T. Russotto	russotto@eng.umd.edu	russotto@wam.umd.edu
rrn: newsgroup "junk" full --- rerouting to news.groups