From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: To: 9fans@9fans.net From: Charles Forsyth Date: Mon, 7 Jul 2008 00:04:39 +0100 In-Reply-To: <78b8a6f4e03e55b062b5f7ab8a09484f@quanstro.net> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] APE printf difference Topicbox-Message-UUID: dceebc32-ead3-11e9-9d60-3106f5b1d025 >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.