1. 01 Jan, 2014 1 commit
  2. 01 Jan, 2013 1 commit
  3. 01 Jan, 2012 1 commit
  4. 01 Jan, 2011 1 commit
  5. 11 Jan, 2010 1 commit
    • Eric Blake's avatar
      stdio: warn on suspicious uses · 524d6a2e
      Eric Blake authored
      Using gets is almost ALWAYS wrong (it is extremely rare that you have
      full control over stdin).  POSIX 2008 marked it as obsolete, even
      though C89 requires it.  Attach a warning to remind developers.  Add
      a comment to sprintf explaining why it does not get this treatment.
      
      Improve the warnings for fseek/fseeko (and ftell/ftello), with
      comments justifying our position.
      
      Some of our unit tests never use large files, so rather than drag
      in a dependency on fseeko, they should be the first compilation
      units to use _GL_NO_LARGE_FILES.
      
      * modules/stdio (Depends-on): Add warn-on-use.
      (Makefile.am): Provide new substitutions.
      * m4/stdio_h.m4 (gl_STDIO_H): Check for inline, ftello, and
      fseeko.
      * lib/stdio.in.h (gets): Always warn on use.
      (fseek, ftell): Adjust when warnings are issued, and honor
      _GL_NO_LARGE_FILES as a way to silence the warning.
      * tests/test-fpurge.c [!GNULIB_FSEEK]: Use new means to squelch
      any warning about large file offsets.
      * tests/test-freadable.c [!GNULIB_FSEEK]: Likewise.
      * tests/test-freading.c [!GNULIB_FSEEK]: Likewise.
      * tests/test-fseeko.c [!GNULIB_FSEEK]: Likewise.
      * tests/test-ftell.c [!GNULIB_FSEEK]: Likewise.
      * tests/test-ftello.c [!GNULIB_FSEEK]: Likewise.
      * tests/test-fwritable.c [!GNULIB_FSEEK]: Likewise.
      * tests/test-fwriting.c [!GNULIB_FSEEK]: Likewise.
      * tests/test-getopt.c [!GNULIB_FTELL]: Likewise.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      524d6a2e
  6. 01 Jan, 2010 1 commit
  7. 24 Dec, 2009 1 commit
  8. 10 Dec, 2009 1 commit
  9. 07 Nov, 2009 1 commit
    • Eric Blake's avatar
      fflush, freadseek: use fseeko, not fseek · 7becd9d7
      Eric Blake authored
      Follow our own advice: fseek is not safe to use on large files.
      
      * lib/fflush.c (clear_ungetc_buffer_preserving_position)
      (clear_ungetc_buffer): Avoid potential problems on large files.
      * lib/freadseek.c (freadseek): Likewise.
      * modules/freadseek (Depends-on): Add fseeko.
      * modules/fseek (configure.ac): Set a witness.
      * tests/test-fflush.c (main): Use fseeko.
      * tests/test-fpurge.c (fseek): Disable link warning.
      * tests/test-freadable.c (fseek): Likewise.
      * tests/test-freading.c (fseek): Likewise.
      * tests/test-fseeko.c (fseek): Likewise.
      * tests/test-ftell.c (fseek): Likewise.
      * tests/test-ftello.c (fseek): Likewise.
      * tests/test-fwritable.c (fseek): Likewise.
      * tests/test-fwriting.c (fseek): Likewise.
      Signed-off-by: default avatarEric Blake <ebb9@byu.net>
      7becd9d7
  10. 11 Apr, 2008 1 commit
  11. 07 Oct, 2007 1 commit
  12. 29 Apr, 2007 1 commit
  13. 14 Apr, 2007 1 commit