diff options
author | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-03-31 09:13:10 +0000 |
---|---|---|
committer | paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-03-31 09:13:10 +0000 |
commit | 2a469906029a8d2429e56fa41183bc3227e0c235 (patch) | |
tree | dd8ec0ce5aa81adc4fe5879c79e666b5549e04a2 /libstdc++-v3/config | |
parent | c40bf9e452697458ef9db03bbf8ba1640da82deb (diff) | |
download | gcc-2a469906029a8d2429e56fa41183bc3227e0c235.tar.gz |
2004-03-31 Paolo Carlini <pcarlini@suse.de>
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80247 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/config')
-rw-r--r-- | libstdc++-v3/config/locale/generic/c_locale.cc | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc index 730c3662ea6..e183a969c22 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<int_type>(__p) != char_traits<char>::eof()) + if (__p && static_cast<int_type>(__p) != char_traits<char>::eof() + && errno != ERANGE) __v = __ld; #endif else |