[Patch] Tweak unbuffered overflow, provide unbuffered seek testcases

Paolo Carlini pcarlini@unitus.it
Wed Jun 11 21:47:00 GMT 2003


Nathan Myers wrote:

>On Wed, Jun 11, 2003 at 11:30:22PM +0200, Paolo Carlini wrote:
>
>>Unfortunately seekpos testing revealed that unbuffered
>>overflow has to be slightly more complicated than we hoped, as
>>this excerpt from seekpos/char/4-io.cc shows:
>>
>>   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'...
>
Nathan, I knew you could write this... ;)
Of course it's not valid code, strictly speaking: I learned this from you.

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...

Paolo.



More information about the Libstdc++ mailing list