[Python-Dev] (no subject)

Tim Peters tim.one@home.com
Fri, 19 Jan 2001 01:39:30 -0500


[some MS internal support group]
> Turns out the C standard explicitly says you can't have an input
> follow iutput on a stream without doing fflush or fseek in-between,
> to make sure the stdio buffer is cleared.  So this program is illegal.

It's undefined (there are no "illegal" programs -- that word doesn't appear
in the std; "undefined" does and has a precise technical meaning).

In the presence of threads-- which the C std doesn't mention --you have to
address issues the std doesn't touch.  To date, MS's is the only C runtime
we've seen that corrupts itself in this situation.  It can do anything it
likes short of blowing up and still be considered a good threaded
implementation.  As is, it has to be considered sub-standard, in the
ordinary sense of displaying worse behavior than other threaded C stdio
implementations.  It falls short there on other counts too (like the lack of
getc_unlocked() & friends), but internal corruption is a particularly
egregious failing.

and-that's-the-end-of-it-for-me-ly y'rs  - tim