From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24845 invoked by alias); 24 Mar 2003 18:26:02 -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 24799 invoked by uid 71); 24 Mar 2003 18:26:02 -0000 Date: Mon, 24 Mar 2003 18:26:00 -0000 Message-ID: <20030324182602.24791.qmail@sources.redhat.com> To: jlquinn@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: =?iso-8859-1?Q?P=E9tur_Run=F3lfsson?= Subject: RE: libstdc++/10093: Regression: Setting failbit in exceptions doesn't work Reply-To: =?iso-8859-1?Q?P=E9tur_Run=F3lfsson?= X-SW-Source: 2003-03/txt/msg01613.txt.bz2 List-Id: The following reply was made to PR libstdc++/10093; it has been noted by GNATS. From: =?iso-8859-1?Q?P=E9tur_Run=F3lfsson?= To: , "Martin Sebor" Cc: , Subject: RE: libstdc++/10093: Regression: Setting failbit in exceptions doesn't work Date: Mon, 24 Mar 2003 18:21:12 -0000 I wrote: > I agree, however I also think that exceptions() should be consistent > with itself, that is, setting exceptions(foobit) should simply mean > that whenever foobit is set in rdstate(), an exception is thrown. > In the current implementation (and to some extent, the standard) > the effect of exceptions(foobit) differs between the various I/O > functions and depends on the value of foobit. Just to clarify: What I think that ios::exceptions() means (and what appears to have been the intent, judging by some old USENET posts) is that this should always work: istream is(...); is.exceptions(...); ... try { is >> x; assert((is.exceptions() & is.rdstate()) =3D=3D 0); } catch (...) { assert((is.exceptions() & is.rdstate()) !=3D 0); } Likewise for ostream and for unformatted I/O functions. Also, the value of is.rdstate() at the end of this code should not depend on the value of is.exceptions(). Regards, Petur