This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/6414: g++ 3.1 tellg() regression within last week
- From: snyder at fnal dot gov
- To: gcc-gnats at gcc dot gnu dot org
- Date: Mon, 22 Apr 2002 22:10:02 -0500
- Subject: libstdc++/6414: g++ 3.1 tellg() regression within last week
- Reply-to: snyder at fnal dot gov
>Number: 6414
>Category: libstdc++
>Synopsis: g++ 3.1 tellg() regression within last week
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Apr 22 20:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: scott snyder
>Release: 3.1 20020422 (prerelease)
>Organization:
>Environment:
System: Linux karma 2.4.9-13 #1 Tue Oct 30 20:11:04 EST 2001 i686 unknown
Architecture: i686
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ../egcs/configure --prefix=/usr/local/egcs --enable-threads=posix --enable-long-long --enable-languages=c,c++,f77
>Description:
After the input stream changes of the last week, tellg() no longer
works correctly. It seems to be returning the raw file position,
not taking into account the buffering that libstdc++ does.
This seems to happen only if tellg() is called after a read.
If a seek intervenes between the read and the tellg(), then the
return from tellg() is as expected (consistent with the above, since
libstd++ won't have anything buffered at that point).
Here's the output i get from the example below:
$ g++ -o x x.cc
$ ./x
0
177
$ wc x.cc
11 26 176 x.cc
$
I expect the second offset printed to be `1'.
This worked ok with the 3.1 branch as of about apr 15, so it looks
like this was introduced during the past week.
sss
>How-To-Repeat:
- x.cc -------------------------------------------------------------------
#include <iostream>
#include <fstream>
int main ()
{
std::ifstream s ("x.cc");
std::cout << s.tellg() << "\n";
s.get ();
std::cout << s.tellg() << "\n";
return 0;
}
--------------------------------------------------------------------------
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: