>i don't see a requirment to flush stdout or any other output stream in c99 ...

"As initially opened, the standard error stream is not fully buffered; the 
standard input and standard
output streams are fully buffered if and only if the stream can be determined 
not to refer
to an interactive device."

but "can be determined" is perhaps a weasel phrase. it's probably expected that 
the system can tell
the difference, but isatty() is a bit devious in the plan 9 world. more serious 
is that APE could face either way.
if it's trying to help portability in, it should have as many functions as 
possible, and those quite generous.
if it's trying to help portability out, it should be strict and emphasise all 
the little pockets of "undefined behaviour" or
"implementation-defined" behaviour, to get you to spell things out. if that's 
the case (and i think that's the design) you need the fflush.
if the former, you'd perhaps want _IOLBF if isatty(1) is true.


Reply via email to