sscanf exposed bugs
Dave Korn
dave.korn@artimi.com
Thu Apr 28 16:57:00 GMT 2005
----Original Message----
>From: Steven J Abner
>Sent: 28 April 2005 14:41
> Sorry for the intrusion, I don't have newlib installed, but I do follow
> the code.
> I happen to be working on a different version of the scanf() family.
> The test that was
> just used for the patch was great! However, upon closer inspection of
> the scanf code,
> would there possibly be missing code for "infinity" ??? I could
> convert and test your
> code but thought it might be faster if you tested for the infinity
> cases yourself.
> Again, sorry for the intrusion.
> Steve
Hi Steve, I assume your post is vaguely directed in my direction?
Well, I think you're probably right. I've only been fixing bugs in this
code, I didn't write it in the first place and so I'm not *very* familiar
with it, but after taking a close look at the spec it seems that the newlib
sscanf _will_ fail to recognize "inf" or "infinity", and that it *is*
supposed to if it wants to be fully compliant. As a matter of fact, it's
also legitimate to append (pretty much) any alphanumeric chars you like to
the text "nan" when representing a NaN, and sscanf is supposed to accept
them. So I think that the sscanf implementation may still be missing a
feature or two.
cheers,
DaveK
--
Can't think of a witty .sigline today....
More information about the Newlib
mailing list