Eric Blake wrote:
> For more details, browse to
> http://www.opengroup.org/austin/aardvark/latest/xshbug3.txt
> and search for Enhancement Request Number 17
> 
> in particular, the new wording states that after fflush, "the file offset
> of the underlying open file description shall be set to the file position
> of the stream, and any characters pushed back onto the stream by ungetc()
> or ungetwc() that have not subsequently been read from the stream shall be
> discarded."

There is still an apparent contradiction between this wording and
<http://www.opengroup.org/onlinepubs/9699919799/functions/ungetc.html>
which says:
    "The value of the file-position indicator for the stream after reading or
     discarding all pushed-back bytes shall be the same as it was before the
     bytes were pushed back."
IMO it should be clarified that this sentence does not apply to fflush().

Suggested change: In the fflush description, change the new wording from

    "the file offset of the underlying open file description shall be
     set to the file position of the stream, and any characters pushed
     back onto the stream by ungetc() or ungetwc() that have not
     subsequently been read from the stream shall be discarded."

to

    "the file offset of the underlying open file description shall be
     set to the file position of the stream, the file position of the stream
     shall be unmodified, and any characters pushed back onto the stream
     by ungetc() or ungetwc() that have not subsequently been read from the
     stream shall be discarded."

Bruno


Reply via email to