This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: SS 20020521 ostream.tcc breaks ostream output
George Garvey wrote:
>>Are you using getline, I suppose?
>>
> Yes. This is the loop, and this is the line that fails:
> if (temp_file.good()) {
>
I see.
As I told you in my previous message, this is the fallout of the fix for
libstdc++/6518, which makes ostream::operator<<(const char*) more robust
wrt null pointers but also sets the failbit in that case (OTOH, many
other implementations of the standard lib do not set the failbit in such
case).
For the time being, you may workaround the problem by always checking
/explicitly/ that the const char* passed to ostream::operator<<(const
char*) is not null, doing nothing in that case, i.e., not calling
operator<< at all.
(f..i, for the lines "temp_file << ident_buffer << '\n';" and "temp_file
<< buffer << '\n';")
Ciao, Paolo.