bug-gnulib
[Top][All Lists]
Advanced

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

Re: fflush after ungetc


From: Bruno Haible
Subject: Re: fflush after ungetc
Date: Sun, 9 Mar 2008 22:31:47 +0100
User-agent: KMail/1.5.4

Eric Blake wrote:
> > On HP-UX 11:
> > When reading from the pipe:
> > c = '#'
> > c = 'i'
> > ungetc result = '@'
> > c = <EOF>
> > c = <EOF>
> 
> Bug - C99 requires that ALL streams have at least one byte of ungetc space, 
> with no limitation on what can go in that buffer.  You only invoke 
> unspecified 
> behavior when you use ungetc() multiple times in a row.

HP-UX 11 supports ungetc. The <EOF> appears because of the fflush() call
and because the input has less than 8192 bytes. But fflush() on a non-
seekable input stream is undefined behaviour anyway, so it cannot count as
a bug, right?

Bruno





reply via email to

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