public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: brendan@zen.org
To: gcc-gnats@gcc.gnu.org
Subject: libstdc++/4545: basic_ostream op<< should set badbit, not failbit
Date: Thu, 11 Oct 2001 08:26:00 -0000	[thread overview]
Message-ID: <20011011152243.26075.qmail@sourceware.cygnus.com> (raw)

>Number:         4545
>Category:       libstdc++
>Synopsis:       basic_ostream op<< should set badbit, not failbit
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 11 08:26:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Brendan Kehoe
>Release:        CVS tree
>Organization:
>Environment:

>Description:
I was mistaken in one piece that I submitted in PR libstdc++/4536.

Rather, according to $27.6.2.5.3(6) the operator
  basic_ostream::operator<<(streambuf*)
should tset badbit, not failbit, if __sbin or __xtrct is set to 0.
>How-To-Repeat:

>Fix:
In attached patch, do setstate of ios_base::badbit instead of ios_base::failbit.
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="diffs-ostream-2.txt"
Content-Disposition: inline; filename="diffs-ostream-2.txt"

2001-08-02  Brendan Kehoe  <brendan@zen.org>

	* include/bits/ostream.tcc (basic_ostream::op<<(streambuf*)): If
	__sbin or __xtrct are 0, set badbit, not failbit, per
	$27.6.2.5.3(6).

*** bits/ostream.tcc.~1~	Wed Jul 18 19:19:42 2001
--- bits/ostream.tcc	Thu Oct 11 14:59:02 2001
*************** namespace std 
*** 347,351 ****
  	__xtrct = __copy_streambufs(*this, __sbin, __sbout);
        if (!__sbin || !__xtrct)
! 	this->setstate(ios_base::failbit);
        return *this;
      }
--- 347,351 ----
  	__xtrct = __copy_streambufs(*this, __sbin, __sbout);
        if (!__sbin || !__xtrct)
! 	this->setstate(ios_base::badbit);
        return *this;
      }


             reply	other threads:[~2001-10-11  8:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-11  8:26 brendan [this message]
2001-10-14 12:36 libstdc++/4545 " Craig Rodrigues
2001-10-25 21:36 libstdc++/4545: " bkoz
2001-11-04  3:49 bkoz
2001-11-04  4:16 bkoz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20011011152243.26075.qmail@sourceware.cygnus.com \
    --to=brendan@zen.org \
    --cc=gcc-gnats@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).