Hi Derek, > From: Derek Price > > This should be irrelevant, since all reference to "struct stat" should > be made using the Solaris definition. Our code never attempts to define > it and I am fairly certain that the "struct stat;" line in glob_.h only > declares the existance of said structure.
[snip] See below. > I am more suspicious of the __restrict keyword. "restrict" should not > cause this sort of warning by my understanding of the C99 spec, but is > it possible that this is doing something we don't understand on > Solaris? Here's the prototype of those function calls: > > #ifdef __USE_GNU > int (*gl_lstat) (__const char *__restrict, struct stat *__restrict); > int (*gl_stat) (__const char *__restrict, struct stat *__restrict); > #else > int (*gl_lstat) (__const char *__restrict, void *__restrict); > int (*gl_stat) (__const char *__restrict, void *__restrict); > #endif > > So, I am guessing that the problem is here. ST is definitately a > "struct stat" in all three of the calls your compiler is warning about. > We should also be able to assume __USE_GNU is set by the line at the > beginning of glob_.h. Even if this wasn't so, by C89 any pointer type > should be castable to void *, so the problem should still be with the > restrict keyword. No amount of playing with "__restrict" made any difference. I removed it completely and the warning was identical. Either this platform's "struct stat" implementation or the compiler's interpretation of same are incompatible with a "struct stat;" forward declaration. The only way I could eliminate the warnings was to either: 1. #include <sys/stat.h> within glob_.h file. 2. Move #include <glob.h> below #include <sys/stat.h> in glob.c file. The patch below implements the latter. I'll commit it if you approve. Ditto, > Regards, Ditto, > Derek Conrad /export/home/cvsusr/ccvs/cvs-1.12:$ cvs diff -Nup lib/glob.c Index: lib/glob.c =================================================================== RCS file: /cvs/ccvs/lib/glob.c,v retrieving revision 1.11 diff -u -p -r1.11 glob.c --- lib/glob.c 20 May 2005 18:39:47 -0000 1.11 +++ lib/glob.c 21 May 2005 00:48:05 -0000 @@ -20,13 +20,13 @@ # include <config.h> #endif -#include <glob.h> - #include <errno.h> #include <sys/types.h> #include <sys/stat.h> #include <stddef.h> +#include <glob.h> + /* Outcomment the following line for production quality code. */ /* #define NDEBUG 1 */ #include <assert.h> _______________________________________________ Bug-cvs mailing list Bug-cvs@gnu.org http://lists.gnu.org/mailman/listinfo/bug-cvs