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]
Other format: [Raw text]

Re: [Patch] Tweak unbuffered overflow, provide unbuffered seek testcases


On Wed, Jun 11, 2003 at 11:48:56PM +0200, Paolo Carlini wrote:
> Nathan Myers wrote:
> >On Wed, Jun 11, 2003 at 11:30:22PM +0200, Paolo Carlini wrote:
> >
> >>  c1 = fb_03.snextc();         //current in pointer +1
> >>  VERIFY( c1 == 't' );
> >>  c2 = fb_03.sputc('\n');      //test current out pointer
> >>
> >This is not valid code.  Or, rather, c2 should be EOF after this,
> >and there is no need to write or store the '\n'...
> 
> But, until we actually change filebuf to non-unified people expects that
> this kind of sequences succeed! There are *dozens* of testcases of this 
> type in the testsuite! And we cannot change the unbuffered behavior while 
> keeping the buffered one intact only for the purpose of sparing 5 lines 
> of code at the end of of overflow...

We'll need to fix those test cases first before we can get the proper 
filebuf fixes accepted anyway.  

In any case no filebuf virtual, other than seekoff and seekpos, should 
_ever_ do a seek, because seek just doesn't work, too often, and when 
it doesn't, the user doesn't know why the other operation that invoked 
it failed.  

So.  It's not necessary to fix all the tests at once.  Just fix the 
tests that fail now; but don't mess up good code with bad.  We know
where we're going, so every patch should get us closer to that.  
The 3.4 deadline is coming up, and we will have to be aggressive 
to beat it.  People are getting progressively less patient with
ABI-breaking changes, so we have to get streambuf right as soon
as possible.

Filebuf and streambuf are still in very bad shape, but getting
better quickly, thanks to you.  Press on!  Be bold!  We are all
behind you.

Nathan Myers
ncm@cantrip.org


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