This is the mail archive of the gcc-prs@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]

libstdc++/3647: in_avail() is not working according to the ISO standard



>Number:         3647
>Category:       libstdc++
>Synopsis:       in_avail() is not working according to the ISO standard
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 11 06:06:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     pinkfloydhomer@yahoo.com
>Release:        gcc version 3.0
>Organization:
>Environment:
cygwin
>Description:
When calling cin.rdbuf()->in_avail() without any input in the buffer, in_avail() blocks until input is ready, and then returns 1, instead of the number of characters read. This is not adhering to the ISO standard. gcc 2.95.x didn't do that. It correctly returns 0 when nothing is available etc.
>How-To-Repeat:
#include <iostream>

using namespace std;

int main()
{       // This call blocks, which it shouldn't.
        cout << cin.rdbuf()->in_avail() << endl;
}
>Fix:

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


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