This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


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

Re: Linux vs. libio


Joe Buck <jbuck@synopsys.COM> writes:

> main ()
> {
> 	printf ("This should be line 1.\n");
> 	cout << "This should be line 2.\n";
> }
> 
> might not work as expected, because stdout and cout will not be
> synchronized.  But most things will work just fine.  It would be much
> the same as the situation on an OS with a proprietary libc: the
> C++ and C i/o code would be separate.

This is required to work according to the C++ standard, so it better
work on an OS with a proprietary libc.  However, it will work much less
efficiently.

What will stop working is:

        fprintf((FILE*) cout.rdbuf(), "This should be line 1.\n");

I certainly don't see many programs breaking because of this ...
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

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