From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28538 invoked by alias); 26 Feb 2003 00:34:54 -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 28511 invoked by uid 48); 26 Feb 2003 00:34:54 -0000 Date: Wed, 26 Feb 2003 00:34:00 -0000 Message-ID: <20030226003454.28510.qmail@sources.redhat.com> To: bkoz@redhat.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, ncm@cantrip.org, nobody@gcc.gnu.org, paolo@gcc.gnu.org, peturr02@ru.is From: paolo@gcc.gnu.org Reply-To: paolo@gcc.gnu.org, bkoz@redhat.com, gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, ncm@cantrip.org, nobody@gcc.gnu.org, paolo@gcc.gnu.org, peturr02@ru.is, gcc-gnats@gcc.gnu.org Subject: Re: libstdc++/9424: i/ostream::operator>>/<<(streambuf*) drops characters X-SW-Source: 2003-02/txt/msg01346.txt.bz2 List-Id: Synopsis: i/ostream::operator>>/<<(streambuf*) drops characters Responsible-Changed-From-To: unassigned->paolo Responsible-Changed-By: paolo Responsible-Changed-When: Wed Feb 26 00:34:53 2003 Responsible-Changed-Why: Analyzed. State-Changed-From-To: open->analyzed State-Changed-By: paolo State-Changed-When: Wed Feb 26 00:34:53 2003 State-Changed-Why: The issue is the following: when a setg(buf, buf, buf + 10) is missing, __copy_streambufs, called by operator>>, ends up using sgetn to fill an internal temporary buffer. The latter, in turn, calls unavoidably the custom uflow, which moves 'current' past the end of the buffer, and underflow, called by sgetc, does not return the expected '1'. Now, everything boild down to the following general question: is an implementation of operator>> allowed to call (indirectly) sgetn? If so, the PR seems "only" a QoI issue, otherwise, a real bug, which can be fixed in many ways. For example, avoiding the call in __copy_streambufs (with a wrapper?) Nathan? Benjamin? Paolo. http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9424