using _FILE_OFFSET_BITS=64 with a non-gcc compiler

Bruno Haible haible@ilog.fr
Tue Nov 6 12:05:00 GMT 2001


Ulrich Drepper writes:

>   #define readdir ((struct dirent *(*) (DIR *)) readdir64)
> 
> makes things work with only a little drawback: function pointer
> assignments of the form
> 
>   struct dirent *(*fp) (DIR *) = &readdir;
> 
> will fail due to a syntax error.

Right,
    #define readdir(d) (((struct dirent *(*) (DIR *)) readdir64) (d))
or
    #define readdir(d) ((struct dirent *) readdir64 (d))

doesn't work either.

    struct dirent *(*fp) (DIR *) = &readdir;

would not give a syntax error, but instead store the wrong function pointer.
We really need

    #define readdir readdir64

Bruno



More information about the Libc-alpha mailing list