C
CptDondo
I've got an issue that I can't figure out.... It has to do with a
compiler warning:
warning: passing arg 3 of `scandir' from incompatible pointer type
Now scandir is declared in dirent.h:
extern int scandir (__const char *__restrict __dir,
struct dirent ***__restrict __namelist,
int (*__selector) (__const struct dirent *),
int (*__cmp) (__const void *, __const void *));
I am calling it as follows:
n = scandir ("/data/pictures", &namelist, ysfilter, alphasort);
and my 3rd argument (ysfilter) is declared as follows:
int ysfilter (struct dirent *dir);
The 4th argument is
extern int alphasort (__const void *__e1, __const void *__e2)
__THROW __attribute_pure__;
so they should be both the same....
I must be blind.... Or I'm missing something really obvious.
Why am I getting a warning?
compiler warning:
warning: passing arg 3 of `scandir' from incompatible pointer type
Now scandir is declared in dirent.h:
extern int scandir (__const char *__restrict __dir,
struct dirent ***__restrict __namelist,
int (*__selector) (__const struct dirent *),
int (*__cmp) (__const void *, __const void *));
I am calling it as follows:
n = scandir ("/data/pictures", &namelist, ysfilter, alphasort);
and my 3rd argument (ysfilter) is declared as follows:
int ysfilter (struct dirent *dir);
The 4th argument is
extern int alphasort (__const void *__e1, __const void *__e2)
__THROW __attribute_pure__;
so they should be both the same....
I must be blind.... Or I'm missing something really obvious.
Why am I getting a warning?