incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Liviu Nicoara (JIRA)" <j...@apache.org>
Subject [jira] Commented: (STDCXX-402) long long stream extraction fails for strings longer than 9 decimal characters
Date Wed, 16 May 2007 14:40:16 GMT

    [ https://issues.apache.org/jira/browse/STDCXX-402?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12496315
] 

Liviu Nicoara commented on STDCXX-402:
--------------------------------------

I guess this one is going to become a priority of sorts. A quick look over the Tools build
results shows all platforms are affected by it (~30 individual streaming tests failing because
of it). 

Your results are intriguing -- when I stepped through the program I always got the wrong results
regardless of how I ran it. Also, I thought I recognized a loophole in the number reading
(string parsing) algorithm in __rw_strtoull. But I might be wrong, of course. I'll take another
quick look at it and let you know.

Liviu

> long long stream extraction fails for strings longer than 9 decimal characters
> ------------------------------------------------------------------------------
>
>                 Key: STDCXX-402
>                 URL: https://issues.apache.org/jira/browse/STDCXX-402
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 27. Input/Output
>         Environment: $ uname -a
> Linux cyberdyne 2.6.17.8 #9 SMP PREEMPT Wed Nov 22 09:34:35 EST 2006 i686 unknown unknown
GNU/Linux
> $ gcc -v
> Using built-in specs.
> Target: i486-slackware-linux
> Configured with: ../gcc-src/configure --prefix=/opt/compilers/gcc-4.1.2 --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-checking --with-gnu-ld --verbose --target=i486-slackware-linux
--host=i486-slackware-linux --enable-languages=c,c++
> Thread model: posix
> gcc version 4.1.2
> Built a 15s version of the library.
>            Reporter: Liviu Nicoara
>
> The following test case:
> $ cat t.cpp
> #include <ios>
> #include <iostream>
> #include <sstream>
> int
> main ()
> {
>     long long n = 0;
>     {
>         std::stringstream s (std::string ("214748364"));
>         s >> n;
>         std::cout << n << "\n";
>     }
>     {
>         std::stringstream s (std::string ("2147483640"));
>         s >> n;
>         std::cout << n << "\n";
>     }
>     return 0;
> }
> Produces inconsistent (but consistently wrong) results in different runs:
> $ ./t
> 214748364
> 9223372036854775807
> $ ./t
> 214748364
> 214748365089
> $ ./t
> 214748364
> 9223372036854775807
> Liviu

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message