scandir()に問題があります: マンページにはこれがプロトタイプとして含まれています:
int scandir(const char *dir, struct dirent ***namelist,
int (*filter)(const struct dirent *),
int (*compar)(const struct dirent **, const struct dirent **));
したがって、私はこれを持っています:
static inline int
RubyCompare(const struct dirent **a,
const struct dirent **b)
{
return(strcmp((*a)->d_name, (*b)->d_name));
}
そして、ここに呼び出しがあります:
num = scandir(buf, &entries, NULL, RubyCompare);
最後に、コンパイラは次のように言います。
warning: passing argument 4 of ‘scandir’ from incompatible pointer type
コンパイラはgcc-4.3.2で、私の CFLAGS は次のとおりです。
-Wall -Wpointer-arith -Wstrict-prototypes -Wunused -Wshadow -std=gnu99
この警告の意味は何ですか? RubyCompare の宣言は私には正しいように見え、警告以外にコードは完全に機能します。