From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3696 invoked by alias); 3 Feb 2003 14:26:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 3682 invoked by uid 71); 3 Feb 2003 14:26:00 -0000 Date: Mon, 03 Feb 2003 14:26:00 -0000 Message-ID: <20030203142600.3681.qmail@sources.redhat.com> To: paolo@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Paolo Carlini Subject: Re: libstdc++/9439: filebuf::sputbackc ignores beginning-of-file Reply-To: Paolo Carlini X-SW-Source: 2003-02/txt/msg00103.txt.bz2 List-Id: The following reply was made to PR libstdc++/9439; it has been noted by GNATS. From: Paolo Carlini To: =?ISO-8859-1?Q?P=E9tur_Run=F3lfsson?= Cc: paolo@gcc.gnu.org, bkoz@redhat.com, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org Subject: Re: libstdc++/9439: filebuf::sputbackc ignores beginning-of-file Date: Mon, 03 Feb 2003 15:21:09 +0100 P=E9tur Run=F3lfsson wrote: >Hi, > =20 > >> Hi. I don't think there is a bug here: I cannot find in the >> standard a specific prescription for the behaviour you >> expect (in particular in 27.5.2.4.4) Can you? >> =20 >> > >Yes. 27.8.1.4 [lib.filebuf.virtuals] p5 describes how pbackfail may >put back the character c. The only cases that can apply here are the >ones starting with > [snip] Ok. I agree with your reading. Therefore it seems that seekoff should be changed to return error in=20 this case. Then pbackfail would pay attention to the negative returned=20 value. The latter changes will also fix libstdc++/9425. >> Indeed, sputbackc calls, as expected, pbackfail, which in=20 >>turns calls seekoff (fstream.tcc, line 218) (pay attention >> to the preceding comment which means that this specific=20 >>situation was considered and _not_ supposed to lead to an >> obvious failure). >> =20 >> >I read "at the beginning of the buffer" as simply meaning that >gptr() =3D=3D eback(), not as "at the beginning of the file". > Yes, you are right. Paolo. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&database=3D= gcc&pr=3D9439