libstdc++/3647: in_avail() is not working according to the ISO standard
pinkfloydhomer@yahoo.com
pinkfloydhomer@yahoo.com
Wed Jul 11 06:06:00 GMT 2001
>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:
More information about the Gcc-bugs
mailing list