This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: <sstream> bug?


On 10 Jul 2000 at 22:01 (-0400), CH Lin wrote:
| As a new member of this mailing list, please accept my apology if my
| question is inappropriate or being asked somewhere else.  That said, 
| consider the following program:
| 
| #include <iostream>
| #include <sstream>
| 
| using namespace std;
| 
| int main()
| {
|   istringstream iss("1 2 3 4 5");
|   int i;
| 
|   while (iss >> i)  cout << i << '\n';
| }
| 
| using g++ 2.95.2 and libstdc++-2.90.8, the above program caused an 
| infinite loop by repeating printing 5.  Is it a known bug? If so,
| is there any patch available?

I'm seeing the same behavior using cvs-20000710. I'm looking at it right
now. For whatever reason, we are not setting failbit when no int is 
extracted from the istringstream -- looks like num_get::do_get(...) is
the culprit, though.

  hth.
    Brent

| CH

-- 
Damon Brent Verner                        o      _     _         _
Cracker Jack? Surprise Certified  _o     /\_   _ \\o  (_)\__/o  (_)
brent@rcfile.org                _< \_   _>(_) (_)/<_    \_| \   _|/' \/
brent@linux1.org               (_)>(_) (_)        (_)   (_)    (_)'  _\o_

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]