Re: [Rd] winbuilder warning message wrt function pointers

2017-12-29 Thread William Dunlap via R-devel
You can legally cast a function pointer to another function pointer, where the signatures differ. (It is not legal to cast between data and function pointers.) I would make typedefs for the various signatures, as the casting syntax is more readable then. Bill Dunlap TIBCO Software wdunlap tibco.c

Re: [Rd] winbuilder warning message wrt function pointers

2017-12-29 Thread Therneau, Terry M., Ph.D.
Bill,   That's a very nice solution.  It is both cleaner looking and preferable to track R's .h files. However, some of my routines don't have void * as the return type (two are int *), and Rdynload has    typedef void * (*DL_FUNC)(); Will this untruth mess anything up? Terry T. On 12/29/

Re: [Rd] winbuilder warning message wrt function pointers

2017-12-29 Thread William Dunlap via R-devel
And remove the cast on the return value of R_GETCCallable. And check that your function is found before using it. #include #include #include void bdsmatrix_prod4(int nrow,int nblock, int *bsize, double *bmat, double *rmat, int nfrail, double *y)

Re: [Rd] winbuilder warning message wrt function pointers

2017-12-29 Thread William Dunlap via R-devel
Try changing static void (*fun)() = NULL; to DL_FUNC fun = NULL; Bill Dunlap TIBCO Software wdunlap tibco.com On Fri, Dec 29, 2017 at 5:14 AM, Therneau, Terry M., Ph.D. < thern...@mayo.edu> wrote: > I've recently updated the coxme package, which calls internal routines > from the bdsmatrix p