This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
Re: libstdc++/2259
- To: nobody at gcc dot gnu dot org
- Subject: Re: libstdc++/2259
- From: benjamin kosnik <bkoz at nabi dot net>
- Date: 13 Mar 2001 02:56:01 -0000
- Cc: gcc-prs at gcc dot gnu dot org,
- Reply-To: benjamin kosnik <bkoz at nabi dot net>
The following reply was made to PR libstdc++/2259; it has been noted by GNATS.
From: benjamin kosnik <bkoz@nabi.net>
To: Hao Huang <hhuang@cs.columbia.edu>
Cc: gcc-gnats@gcc.gnu.org
Subject: Re: libstdc++/2259
Date: Mon, 12 Mar 2001 18:47:11 -0800
> I just downloaded the latest cygwin gcc and the bug seems to be fixed. However,
> now getline will leave the carriage return at the end of the line in the string
> (which was not the case before).
>
> >gcc -v
> Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/gcc-2.95.2-9/specs
> gcc version gcc-2.95.2-9 19991024 (cygwin experimental)
>
> Thanks!
Here's what I get with the following:
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main(int argc, char** argv)
{
ifstream in(argv[1]);
string line;
getline(in, line);
cout << "0: " << line << endl;
cout << "gcount = " << in.gcount() << endl;
size_t pos = in.tellg();
cout << "remember " << pos << endl;
while (getline(in, line))
{
cout << "0: [" << line << ']' << endl;
}
in.clear();
in.seekg(pos, ios::beg);
cout << "restore " << in.tellg() << endl;
while (getline(in, line))
{
cout << "1: [" << line << ']' << endl;
}
}
%COMP.sh "-static" 2259.cpp
<bkoz@fillmore>
/mnt/hd/bliss/src.gcc/libstdc++-v3/testsuite %a.out
0:
gcount = 0
remember 4294967295
restore -1
Again, I ask you to simplify. Please try to narrow down the problem. At
least provide sample compile lines and invocation lines, and expected
output?
-benjamin