This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/6746: ifstream::readsome() always returns zero


The following is the testcase mentioned by submitter in the PR:

#include <fstream>
#include <iostream>
using namespace std;

int main(int, char**)
{
        streamsize sum = 0;
        ifstream ifs(__FILE__);

        while (ifs.good())
        {
                char buf[1024];
                streamsize gotten = ifs.readsome(buf, sizeof buf);
                sum += gotten;
                cout << gotten << " (" << sum << ")" << endl;
        }

        return 0;
}

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=6746 



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