libstdc++/3114: DR 129: ostream::seekp() does not report an error
bkoz@gcc.gnu.org
bkoz@gcc.gnu.org
Mon Jun 11 11:28:00 GMT 2001
Synopsis: DR 129: ostream::seekp() does not report an error
Responsible-Changed-From-To: unassigned->bkoz
Responsible-Changed-By: bkoz
Responsible-Changed-When: Mon Jun 11 11:28:24 2001
Responsible-Changed-Why:
Mine.
State-Changed-From-To: open->feedback
State-Changed-By: bkoz
State-Changed-When: Mon Jun 11 11:28:24 2001
State-Changed-Why:
I'm testing this patch
Index: include/bits/istream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/istream.tcc,v
retrieving revision 1.15
diff -c -p -r1.15 istream.tcc
*** istream.tcc 2001/05/31 20:33:06 1.15
--- istream.tcc 2001/06/11 18:27:26
*************** namespace std
*** 959,965 ****
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekpos(__pos, ios_base::in);
#endif
}
catch(exception& __fail)
--- 959,969 ----
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::in);
!
! // 129. Need error indication from seekp() and seekg()
! if (__err == pos_type(off_type(-1)))
! this->setstate(failbit);
#endif
}
catch(exception& __fail)
*************** namespace std
*** 987,993 ****
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekoff(__off, __dir, ios_base::in);
#endif
}
catch(exception& __fail)
--- 991,1002 ----
{
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! pos_type __err = this->rdbuf()->pubseekoff(__off, __dir,
! ios_base::in);
!
! // 129. Need error indication from seekp() and seekg()
! if (__err == pos_type(off_type(-1)))
! this->setstate(failbit);
#endif
}
catch(exception& __fail)
Index: include/bits/ostream.tcc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/bits/ostream.tcc,v
retrieving revision 1.11
diff -c -p -r1.11 ostream.tcc
*** ostream.tcc 2001/05/31 12:14:54 1.11
--- ostream.tcc 2001/06/11 18:27:27
*************** namespace std
*** 411,420 ****
bool __testok = this->fail() != true;
if (__testok)
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekpos(__pos, ios_base::out);
#endif
return *this;
}
--- 411,426 ----
bool __testok = this->fail() != true;
if (__testok)
+ {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::out);
!
! // 129. Need error indication from seekp() and seekg()
! if (__err == pos_type(off_type(-1)))
! this->setstate(failbit);
#endif
+ }
return *this;
}
*************** namespace std
*** 426,434 ****
bool __testok = this->fail() != true;
if (__testok)
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekoff(__off, __d, ios_base::out);
#endif
return *this;
}
--- 432,446 ----
bool __testok = this->fail() != true;
if (__testok)
+ {
#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
// 136. seekp, seekg setting wrong streams?
! this->rdbuf()->pubseekoff(__off, __d, ios_base::out);
!
! // 129. Need error indication from seekp() and seekg()
! if (__err == pos_type(off_type(-1)))
! this->setstate(failbit);
! }
#endif
return *this;
}
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3114&database=gcc
More information about the Gcc-bugs
mailing list