# HG changeset patch # User Bruno Haible # Date 1177801320 0 # Node ID 6f41e282286308ca049e1489bd75e74b22e105cd # Parent cecd0b715bab42bbeba8b0a2b2c68daee3ccdb4b Warn when fseek or ftell are used. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-04-28 Bruno Haible + + * lib/stdio_.h (fseek, ftell): Provide link warnings suggesting to use + fseeko and ftello. + Suggested by Eric Blake. + 2007-04-28 Jim Meyering Avoid false-negative in gl_STDINT_H's C99 conformance test. diff --git a/lib/stdio_.h b/lib/stdio_.h --- a/lib/stdio_.h +++ b/lib/stdio_.h @@ -231,6 +231,16 @@ fseeko (f, o, w)) #endif +#if defined GNULIB_POSIXCHECK +# ifndef fseek +# define fseek(f,o,w) \ + (GL_LINK_WARNING ("fseek cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use fseeko function for handling of large files"), \ + fseek (f, o, w)) +# endif +#endif + #if @GNULIB_FTELLO@ # if !@HAVE_FTELLO@ /* Assume 'off_t' is the same type as 'long'. */ @@ -245,6 +255,16 @@ ftello (f)) #endif +#if defined GNULIB_POSIXCHECK +# ifndef ftell +# define ftell(f) \ + (GL_LINK_WARNING ("ftell cannot handle files larger than 4 GB " \ + "on 32-bit platforms - " \ + "use ftello function for handling of large files"), \ + ftell (f)) +# endif +#endif + #if @GNULIB_FFLUSH@ # if @REPLACE_FFLUSH@ # define fflush rpl_fflush