bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Austin group ruling on ungetc vs. fflush


From: Bruno Haible
Subject: Re: Austin group ruling on ungetc vs. fflush
Date: Fri, 16 Jan 2009 01:15:33 +0100
User-agent: KMail/1.9.9

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

[Prev in Thread] Current Thread [Next in Thread]