You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Martin Sebor (JIRA)" <ji...@apache.org> on 2007/10/27 23:29:50 UTC

[jira] Updated: (STDCXX-402) long long stream extraction fails for strings longer than 9 decimal characters

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

Martin Sebor updated STDCXX-402:
--------------------------------

             Severity: Incorrect Behavior
    Affects Version/s: 4.1.2
                       4.1.3
                       4.1.4

> 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
>    Affects Versions: 4.1.2, 4.1.3, 4.1.4
>         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
>            Assignee: Martin Sebor
>             Fix For: 4.2
>
>
> 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.