On Sun, Jun 17, 2012 at 11:40 PM, Bruno Haible <br...@clisp.org> wrote: > Isaac Dunham wrote: >> > The test as it stands is "error out on unsupported platforms unless >> > user specifies to use slow method". >> > My proposal is "On unsupported platforms, use the slow method instead >> > of erroring out." > > If we did this, nobody would report to bug-gnulib (or to the libc maintainer) > the need to port the functions. You would get a slow or buggy program > instead.
You can add a test program that detects an unported-to libc. So they would get a slow program but also a make check failure. >> - #error "Please port gnulib freadahead.c to your platform! Look at the >> definition of fflush, fread, ungetc on your system, then report this to >> bug-gnulib." >> + /* This implementation is correct on any ANSI C platform. It is just >> + awfully slow. */ >> + return freading(fp) && !feof(fp); >> + #warning "Please port gnulib freadahead.c to your platform! Look at the >> definition of fflush, fread, ungetc on your system, then report this to >> bug-gnulib." >> #endif >> } > > This alternative code is not correct. On a stream freshly opened for reading > it returns 1 where is should return 0 instead. Indeed, it is only correct to use this replacement in close_stdin. Paolo