From e004c3313e6aaa46af99e823e98ebc32be8757a2 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 31 Mar 2004 09:13:10 +0000 Subject: [PATCH] c_locale.cc (__convert_to_v(long double&)): In v3 uses of sscanf... 2004-03-31 Paolo Carlini * config/locale/generic/c_locale.cc (__convert_to_v(long double&)): In v3 uses of sscanf, the special floating-point numbers INF, INFINITY, etc., cannot occur in input, therefore, if the latter is too large, ERANGE is always stored in errno, no need of finitel. From-SVN: r80247 --- libstdc++-v3/ChangeLog | 7 +++++++ libstdc++-v3/config/locale/generic/c_locale.cc | 9 ++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index d78e3a949e00..193a6a5820bc 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2004-03-31 Paolo Carlini + + * config/locale/generic/c_locale.cc (__convert_to_v(long double&)): + In v3 uses of sscanf, the special floating-point numbers INF, + INFINITY, etc., cannot occur in input, therefore, if the latter + is too large, ERANGE is always stored in errno, no need of finitel. + 2004-03-30 Benjamin Kosnik PR libstdc++/14783 diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc index 730c3662ea69..e183a969c227 100644 --- a/libstdc++-v3/config/locale/generic/c_locale.cc +++ b/libstdc++-v3/config/locale/generic/c_locale.cc @@ -128,13 +128,8 @@ namespace std long double __ld; errno = 0; int __p = sscanf(__s, "%Lf", &__ld); - if (errno == ERANGE) - __p = 0; -#ifdef _GLIBCXX_HAVE_FINITEL - if ((__p == 1) && !finitel (__ld)) - __p = 0; -#endif - if (__p && static_cast(__p) != char_traits::eof()) + if (__p && static_cast(__p) != char_traits::eof() + && errno != ERANGE) __v = __ld; #endif else -- 2.47.2