This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: in_avail() error. Major compliance problem
- To: David Rasmussen <pinkfloydhomer at yahoo dot com>
- Subject: Re: in_avail() error. Major compliance problem
- From: Florian Weimer <fw at deneb dot enyo dot de>
- Date: Sun, 28 Oct 2001 01:10:51 +0200
- Cc: gcc at gcc dot gnu dot org
- References: <E15wsYD-0003VA-00@mail.oek.dk>
David Rasmussen <pinkfloydhomer@yahoo.com> writes:
> #include <iostream> int main()
> {
> std::cout << std::cin.rdbuf()->in_avail() << std::endl;
> return 0;
> }
>
> This simple code should write a 0 and exit immediately. This is what happens
> with gcc 2.95.3 and the library that comes with that. With gcc 3.0.2, it is
> hanging blockingly until enter is pressed, and then writes a 1.
This behavior is probably correct as far as the C++ standard is
concerned, I'm afraid.