libstdc++/2259: istream::tellg/seekg cause character loss
hhuang@cs.columbia.edu
hhuang@cs.columbia.edu
Sat Mar 10 20:36:00 GMT 2001
>Number: 2259
>Category: libstdc++
>Synopsis: istream::tellg/seekg cause character loss
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Mar 10 20:36:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Hao Huang
>Release: unknown-1.0
>Organization:
>Environment:
~>gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.2-6/specs
gcc version 2.95.2-6 19991024 (cygwin experimental)
>Description:
istream::tellg causes character loss while using getline(string &). istream::seekg with the saved value will result in one character beyond the saved position.
>How-To-Repeat:
This can be demostrated with the attach code and a file with the following 2 lines (the content seem to have an impact on the result):
line1 aaaaaaaa bbbbbbbb ccccccccc
line2 dddddddd
The running result is as follows:
0: line1 aaaaaaaa bbbbbbbb ccccccccc
gcount = 0
remember 36
0: [ine2 dddddddd]
restore 37
1: [ne2 dddddddd]
>Fix:
No idea yet.
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list