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] Created: (STDCXX-402) long long stream extraction fails for strings longer than 9 decimal characters
Date Mon, 07 May 2007 16:18:15 GMT
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