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: Eric Blake
Subject: Re: Austin group ruling on ungetc vs. fflush
Date: Thu, 15 Jan 2009 21:56:39 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bruno Haible on 1/15/2009 6:09 PM:
>             "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."
> !      3) Here we are discarding all pushed-back bytes.
> ! 
> !      Unfortunately it is impossible to implement this on platforms with
> !      _IOERR, because an ungetc() on this platform prepends the pushed-back
> !      bytes to the buffer without an indication of the limit between the
> !      pushed-back bytes and the read-ahead bytes.  */
> !   clear_ungetc_buffer (stream);

POSIX states that only a single ungetc() is portable (and even then, only
when beyond position 0 in the file).  Is it worth making the assumption
that gnulib clients will never unget more than one byte without an
intervening read, seek, or write?  Would such an assumption help these
platforms?

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAklwE4cACgkQ84KuGfSFAYDskgCfSg59sZUbcO9XMpMzX7mHHHxj
WTcAn1zGj9WyOWdS3cMg13L44lwj5mee
=PDUq
-----END PGP SIGNATURE-----




reply via email to

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