bug-gnulib
[Top][All Lists]
Advanced

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

Re: new module 'fseeko'


From: Bruno Haible
Subject: Re: new module 'fseeko'
Date: Sun, 29 Apr 2007 01:02:02 +0200
User-agent: KMail/1.5.4

Eric Blake wrote:
> Should we also add a link warning for programs that use fseek/ftell
> instead of fseeko/ftello, telling the user they are potentially
> artificially limited by not using off_t?

Yes. This implements your suggestion.

2007-04-28  Bruno Haible  <address@hidden>

        * lib/stdio_.h (fseek, ftell): Provide link warnings suggesting to use
        fseeko and ftello.
        Suggested by Eric Blake.

*** lib/stdio_.h        27 Apr 2007 11:09:11 -0000      1.22
--- lib/stdio_.h        28 Apr 2007 23:00:32 -0000
***************
*** 231,236 ****
--- 231,246 ----
      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 address@hidden@
  /* Assume 'off_t' is the same type as 'long'.  */
***************
*** 245,250 ****
--- 255,270 ----
      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





reply via email to

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