[PATCH] libstdc++/5045: wrong numeric_limits::digits10 forinteger types

Paolo Carlini pcarlini@unitus.it
Mon Dec 10 07:36:00 GMT 2001


Philip Martin wrote:

> While I believe the above is correct (I reported the problem after
> all), applying it will affect the new number input code in the file
> libstdc++-v3/include/bits/locale_facet.tcc.
>
> http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=3720&database=gcc
>
> In locale_facets.tcc digits10 is used to determine the maximum number
> of digits to read, with the above patch it will read one fewer. I
> think one has to read digits10+1 digits to allow the full range of
> input values.

I see. If the code inside locale_facet.tcc is exactly as you say it is (I cannot
verify this right now) we'll have to modify it too.
In that case I will resubmit the complete fix.

By the way, are you willing to prepare a patch + ChangeLog + careful testing? You have
not only submitted the PR, but also identified a complete fix for it and your name
should be the *only* one to appear in the ChangeLog (I will commit it for you upon
approval of the maintainers)

Thanks,
Paolo.




More information about the Libstdc++ mailing list