[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#121642: libstdc++3: Unable to do buffered cout (?)



> > 	So, is the final behaviour (aka: non-buffered output) the standard
> > behaviour? My guess is not ... if so, is there a way to fix it?

http://gcc.gnu.org/onlinedocs/libstdc++/27_io/howto.html#8


> There is certainly a way to fix it. The problem is that every solution
> that has been considered so far would
> - require changes to glibc
> - thus fail to work on older versions of glibc
> - may break support for older C++ compiler in glibc
> - break the iostreams ABI of g++ 3.0.
> 
> To my knowledge, nothing has been done beyond considering solutions so
> far, but you may ask on the libstdc++ list for their analysis of the
> current state of affairs.

Well, the problem isn't so much with glibc anymore, since 3.0 doesn't use
bits and pieces of glibc for I/O like we did in 2.x.  (Not even on Linux.)
Major problems existed between C synchronization requirements and getting
redirection to work correctly, i.e.,

    ./a.out

would work, but

    ./a.out > file

would break, or vice versa, due to the effects of seeking.

(You'd think that this would be completely unrelated... it surprised me too.)

Anyhow, the approach mentioned on the web page there helps in many
situations.  The underlying problem is still be addressed.  It's ugly.

As an aside, the glibc-and-I/O relationship is also described on that web page.


Phil

-- 
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace.  We seek
not your counsel, nor your arms.  Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen.            - Samuel Adams



Reply to: