On Wed, 12 Jun 2013 16:41:03 -0400, Dmitry Olshansky
<dmitry.o...@gmail.com> wrote:
12-Jun-2013 22:36, Steven Schveighoffer пишет:
On Wed, 12 Jun 2013 12:40:53 -0400, Walter Bright
...
No, this is incorrect. fflush is not called on subsequent writeln.
Not only that, but we only have to do this on FILE * that were
initialized with unknown file descriptors (such as
stdin/stdout/stderr). If we use fopen, you don't have to do this.
Steve, the only unchecked place right now is in the _last_ flush. Even
if you flush on first call it won't help some other forms of errors
(other then it's not writable to begin with). The only thing it will do
is surprise certain kinds of applications that use fdopen with "passed
in" sockets and whatnot. Basically a year later we'll see puzzled folks
with strace printouts.
The two problems described are separate problems. Both can be addressed
differently.
I think it's worth putting the flush at the end, and generating an
exception. But if we can catch the error on intialization, or at least on
first use, it would be beneficial.
-Steve