Make GoF C code ISO compatible
tnagler opened this issue · 1 comments
tnagler commented
My C compiler now gives the following warning:
gof.c: In function ‘Bj’:
gof.c:267:33: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
qsort(u[j],*d,sizeof(double),(void *)comp_nums);
^
gof.c:267:4: warning: ISO C forbids passing argument 4 of ‘qsort’ between function pointer and ‘void *’ [-Wpedantic]
qsort(u[j],*d,sizeof(double),(void *)comp_nums);
^
In file included from /usr/lib/R/lib/R/include/R.h:45:0,
from include/vine.h:22,
from gof.c:1:
/usr/include/stdlib.h:765:13: note: expected ‘__compar_fn_t’ but argument is of type ‘void *’
extern void qsort (void *__base, size_t __nmemb, size_t __size,
^
gof.c: In function ‘SimulateBj’:
gof.c:330:31: warning: ISO C forbids conversion of function pointer to object pointer type [-Wpedantic]
qsort(tmp,*d,sizeof(double),(void *)comp_nums);
^
gof.c:330:3: warning: ISO C forbids passing argument 4 of ‘qsort’ between function pointer and ‘void *’ [-Wpedantic]
qsort(tmp,*d,sizeof(double),(void *)comp_nums);
^
In file included from /usr/lib/R/lib/R/include/R.h:45:0,
from include/vine.h:22,
from gof.c:1:
/usr/include/stdlib.h:765:13: note: expected ‘__compar_fn_t’ but argument is of type ‘void *’
extern void qsort (void *__base, size_t __nmemb, size_t __size,
^
Could you look into that Ulf? It does not cause a WARNING or NOTE in CRAN checks, so it's not urgent.