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

tony.oliver@mci.co.uk tony.oliver@mci.co.uk
Mon May 20 10:16:00 GMT 2002


>Number:         6746
>Category:       libstdc++
>Synopsis:       ifstream::readsome() always returns zero
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 20 10:16:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Tony Oliver
>Release:        gcc-3.1
>Organization:
>Environment:
sparc-sun-solaris2.8
Thread model: posix
>Description:
Calling ifstream::readsome() always yields a return value of zero (no bytes read).  No stream error flags are set.  This behaviour has been introduced in release gcc-3.1: it worked fine in gcc-3.0.4.

The problem appears to be confined to the filebuf part of ifstream, not the istream part, since (for instance) istringstream::readsome() does not suffer from this problem.

My installation of gcc-3.1 was configured with the following options (/home/to0001/ is my networked home directory):
--prefix=/home/to0001/app/gcc-3.1
--enable-languages=c,c++
--disable-shared
--verbose

Trivial test program source code attached.

Expected output (as output by gcc-3.0.4 version):

308 (308)
0 (308)

Actual output:

0 (0)
0 (0)
0 (0)
... [forever]
>How-To-Repeat:
g++ -ansi -pedantic -Wall -o gcc-test gcc-test.c++

gcc-test
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list