This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Analysis of libstdc++/2071 test case
- To: rittle at rsch dot comm dot mot dot com
- Subject: Re: Analysis of libstdc++/2071 test case
- From: Carlo Wood <carlo at alinoe dot com>
- Date: Wed, 9 May 2001 16:12:35 +0200
- Cc: libstdc++ at gcc dot gnu dot org
- References: <200105090656.f496uUn54612@latour.rsch.comm.mot.com>
On Wed, May 09, 2001 at 01:56:30AM -0500, Loren James Rittle wrote:
> #include <errno.h>
> #include <stdio.h>
>
> int main ()
> {
> char buf;
> char buf2;
> int error = 0;
>
> fread (&buf, 1, 1, stdin);
> fseek (stdin, 0, SEEK_CUR);
> fread (&buf2, 1, 1, stdin);
>
> printf ("%d %d %d\n", buf, buf2, error);
> }
>
> When run on Red Hat Linux 6.1 (Cartman) (with whatever glibc was the default):
>
> ; a.out
> 1234<CR>
> 1 2
[...]
With glibc-2.2, I get (on a linux box that is mostly rawhide-1.0):
~>g++-2.95.1 -g test.cc
~>a.out
1234
49 50 0
~>g++-2.95.2 -g test.cc
~>a.out
1234
49 50 0
~>g++-2.95.3 -g test.cc
~>a.out
1234
49 50 0
~>g++-2.96 -g test.cc
~>a.out
1234
49 50 0
~>g++-3.0 -g test.cc
~>a.out
1234
49 50 0
~>g++-3.1 -g test.cc
~>a.out
1234
49 50 0
An output of "1 2" seems highly unlikely, it should be "49 50 0".
--
Carlo Wood <carlo@alinoe.com>