This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/3647: in_avail() is not working according to the ISO standard
- To: gcc-gnats at gcc dot gnu dot org
- Subject: libstdc++/3647: in_avail() is not working according to the ISO standard
- From: pinkfloydhomer at yahoo dot com
- Date: 11 Jul 2001 13:00:45 -0000
- Reply-To: pinkfloydhomer at yahoo dot com
>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: