This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: Something terribly wrong with gcc-3.0.4 Linux


On Thu, Mar 28, 2002 at 11:00:20AM -0500, Neal D. Becker wrote:
> >>>>> "Jakub" == Jakub Jelinek <jakub@redhat.com> writes:
> 
>     Jakub> On Thu, Mar 28, 2002 at 04:51:52PM +0100, Paolo Carlini wrote:
>     >> Jakub Jelinek wrote:
>     >> 
>     >> >If libstdc++-v3 switches (optionally) back to libio, this overhead would
>     >> >go away.
>     >> >
>     >> Indeed.
>     >> 
>     >> >But I believe for std::cout << "hello " << "world";
>     >> >even without libio we should be able to write(1, "hello ", 6); write(1, "world", 5);
>     >> >instead of 11 writes.
>     >> >
> 
> What's wrong with:
> 
> fflush(stdio);
> write (1, "hello world");
> 
> Only 1 call to write?

Unless there is an optimization which changes std::cout << "hello " << "world";
into std::cout << "hello world";
that means buffering in std::cout which means it is not in sync with stdio
(e.g. in std::cout << "hello " << foo () << "world"; foo could use stdio
and it would make a difference).

	Jakub


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