This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: libstdc++/4536 ostream seekp & istream seekg should scope failbit


http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=4536&database=gcc

Hi,

Following patch addresses PR 4536 on mainline.

"ostream's seekp and istream's seekg methods need to use failbit as
`ios_base::failbit'.
It may be worth noting that the setting of failbit goes in line 
with the change for library DR #129. The standard pre-DR edits 
does not include the clause in $27.6.2.4(2) regarding the setting 
of failbit."


2001-10-11  Brendan Kehoe  <brendan@zen.org>

	* bits/ostream.tcc (seekp): Scope use as ios_base::failbit.
	* bits/istream.tcc (seekg): Likewise.

Index: include/bits/ostream.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/ostream.tcc,v
retrieving revision 1.15
diff -u -p -r1.15 ostream.tcc
--- ostream.tcc	2001/09/25 23:51:17	1.15
+++ ostream.tcc	2001/10/10 11:44:23
@@ -346,7 +346,7 @@ namespace std 
       if (__sbin && __cerb)
 	__xtrct = __copy_streambufs(*this, __sbin, __sbout);
       if (!__sbin || !__xtrct)
-	this->setstate(ios_base::failbit);
+	this->setstate(ios_base::failbit);
       return *this;
     }
 
Index: include/bits/istream.tcc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/istream.tcc,v
retrieving revision 1.19
diff -u -p -r1.19 istream.tcc
--- istream.tcc	2001/09/25 23:51:17	1.19
+++ istream.tcc	2001/10/10 11:44:13
@@ -963,7 +963,7 @@ namespace std 
 
 // 129. Need error indication from seekp() and seekg()
 	      if (__err == pos_type(off_type(-1)))
-		this->setstate(failbit);
+		this->setstate(ios_base::failbit);
 #endif
 	    }
 	  catch(exception& __fail)
@@ -996,7 +996,7 @@ namespace std 
 
 // 129. Need error indication from seekp() and seekg()
 	      if (__err == pos_type(off_type(-1)))
-		this->setstate(failbit);
+		this->setstate(ios_base::failbit);
 #endif
 	    }
 	  catch(exception& __fail)
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@mediaone.net          


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]