Re: Austin group ruling on ungetc vs. fflush

2009-01-17 Thread Bruno Haible
And this, finally, makes the test-fflush2.sh test failure on mingw go away. 2009-01-17 Bruno Haible Avoid test-fflush2.sh failure on mingw. * tests/test-fflush2.c: Include binary-io.h. (main): Put standard input into binary mode. * modules/fflush-tests (Depends-

Re: Austin group ruling on ungetc vs. fflush

2009-01-17 Thread Bruno Haible
Eric Blake wrote: > > If you remove this special-casing, one of the tests in the testsuite fails. > > Namely when the first fseek after fflush attempts to position beyond end of > > file. That's something that lseek() does not support, but we are forced to > > used lseek() in this situation, by POS

Re: Austin group ruling on ungetc vs. fflush

2009-01-17 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 1/17/2009 6:45 AM: > If you remove this special-casing, one of the tests in the testsuite fails. > Namely when the first fseek after fflush attempts to position beyond end of > file. That's something that lseek() does not s

Re: Austin group ruling on ungetc vs. fflush

2009-01-17 Thread Bruno Haible
Hi Eric, > In general, a big thanks for tackling this. Have you filed a glibc bug > report on this? Done here: > > - off_t pos = lseek (fileno (fp), offset, whence); > > + /* We get here when an fflush() call immediately preceded t

Re: Austin group ruling on ungetc vs. fflush

2009-01-17 Thread Bruno Haible
Hi Eric, > > "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. > > ! >

Re: Austin group ruling on ungetc vs. fflush

2009-01-15 Thread Eric Blake
-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 pus

Re: Austin group ruling on ungetc vs. fflush

2009-01-15 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Bruno Haible on 1/15/2009 4:24 PM: > The fflush-after-ungetc test fails on glibc, *BSD, mingw platforms. > This makes it work for glibc systems - at the cost of introducing a > slim override of fflush(). > > Eric, comments or objections?

Re: Austin group ruling on ungetc vs. fflush

2009-01-15 Thread Bruno Haible
This makes fflush after ungetc work on BSD systems. 2009-01-15 Bruno Haible Make fflush-after-ungetc POSIX compliant on BSD systems. * lib/fflush.c (clear_ungetc_buffer_preserving_position): New function. (clear_ungetc_buffer): Implement also for other systems.

Re: Austin group ruling on ungetc vs. fflush

2009-01-15 Thread Bruno Haible
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 f

Re: Austin group ruling on ungetc vs. fflush

2009-01-15 Thread Bruno Haible
The fflush-after-ungetc test fails on glibc, *BSD, mingw platforms. This makes it work for glibc systems - at the cost of introducing a slim override of fflush(). Eric, comments or objections? 2009-01-15 Bruno Haible Make fflush-after-ungetc POSIX compliant on glibc systems.

Re: Austin group ruling on ungetc vs. fflush

2009-01-15 Thread Bruno Haible
Hi Eric, > A while ago, we wrote some unit tests that failed on a number of systems > with different behaviors of fflush after ungetc (particularly if you used > ungetc to push back a different byte than what was originally read). At > the time, Bruno ended up commenting the tests out until we ha

Austin group ruling on ungetc vs. fflush

2009-01-09 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 A while ago, we wrote some unit tests that failed on a number of systems with different behaviors of fflush after ungetc (particularly if you used ungetc to push back a different byte than what was originally read). At the time, Bruno ended up comment