Warnung bei Verwendung von qsort in C
Ich habe meine Vergleichsfunktion geschrieben
int cmp(const int * a,const int * b)
{
if (*a==*b)
return 0;
else
if (*a < *b)
return -1;
else
return 1;
}
und ich habe meine Erklärung
int cmp (const int * value1,const int * value2);
und ich rufe qsort in meinem Programm so auf
qsort(currentCases,round,sizeof(int),cmp);
wenn ich es kompiliere, erhalte ich die folgende Warnung
warning: passing argument 4 of ‘qsort’ from incompatible pointer type
/usr/include/stdlib.h:710: note: expected ‘__compar_fn_t’ but argument is of type ‘int
(*)(const int *, const int *)’
Das Programm funktioniert einwandfrei, also ist mein einziges Anliegen, warum es nicht gefällt, wie ich das benutze?