PR libstdc++/6750

Paolo Carlini pcarlini@unitus.it
Tue May 21 01:55:00 GMT 2002


Peter Schmid wrote:

>I investigated PR libstdc++/6750 and found out that reverting
>the patch
>2002-05-18  Benjamin Kosnik  <bkoz@redhat.com>
>
>	PR libstdc++/6518
>	* include/bits/ostream.tcc (ostream::operator<<(const char*)): Fix
>	for null case.
>	(ostream::operator<<(const _CharT*)): Same.
>	(ostream<char>::operator<<(const char*)): Same.
>	* testsuite/27_io/ostream_inserter_char.cc (test07): Add test.
>fixes the io related problems.
>
>Therefore, I ask to revert this patch which causes severe io related
>problems.
>
Hi Peter,

indeed, the testcase you submitted as part of libstdc++/6750 is 
sensitive to this recent change, since, after terminating a getline with 
a single delim char ('\n') the buffer turns out to be empty and triggers 
the new code checked in by Benjamin.

If I understand well libstdc++/6518 commit, the new code is tought to 
deal more gracefully with the undefined behaviour (avoiding a core 
dump), but still sets the badbit. A few other implementations, however, 
don't set it.

Benjamin, what about not setting the badbit in v3 too?

Ciao, Paolo.



More information about the Libstdc++ mailing list