This is the mail archive of the
libstdc++@sources.redhat.com
mailing list for the libstdc++ project.
Re: <sstream> bug?
- To: CH Lin <ch dot lin at prodigy dot net>
- Subject: Re: <sstream> bug?
- From: brent verner <brent at rcfile dot org>
- Date: Tue, 11 Jul 2000 00:02:11 -0400
- Cc: stdc++ <libstdc++ at sourceware dot cygnus dot com>
- References: <002301bfeadb$ec59f8c0$0200a8c0@micron>
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_