On AIX 5.1, the compiler shows these warnings: "glob.c", line 666.47: 1506-280 (E) Function argument assignment between types "struct stat*" and "struct stat64*" is not allowed. "glob.c", line 1016.42: 1506-280 (E) Function argument assignment between types "struct stat*" and "struct stat64*" is not allowed. "glob.c", line 1066.43: 1506-280 (E) Function argument assignment between types "struct stat*" and "struct stat64*" is not allowed.
This warning sounds more dangerous than it is. Nevertheless, it's good to silence it. What's happening, is that config.h defines #define _LARGE_FILES 1 which instructs sys/stat.h to enable LFS variants of the structs and functions. In particular it defines 'struct stat64' and then does #define stat stat64 Now, when glob.c is compiled, glob-libc.h defines function types that use 'struct stat' (using just a forward declaration). Then later <sys/stat.h> is included, and further references to 'stat' macroexpand to 'stat64'. So the fix is simply to make sure the #define stat stat64 is in place before glob-libc.h starts dealing with it. I'm applying this: 2007-03-25 Bruno Haible <[EMAIL PROTECTED]> * lib/glob_.h: Include <sys/stat.h>. Avoids warnings on AIX 5.1. *** lib/glob_.h 3 Mar 2007 12:35:26 -0000 1.7 --- lib/glob_.h 25 Mar 2007 19:27:58 -0000 *************** *** 27,32 **** --- 27,37 ---- #include <stddef.h> + /* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64". + Make sure this definition is seen before glob-libc.h defines types that + rely on 'struct stat'. */ + #include <sys/stat.h> + #ifndef __BEGIN_DECLS # define __BEGIN_DECLS # define __END_DECLS