Displaying 2 results from an estimated 2 matches for "r_nativeargstyle".
2017 Apr 25
0
R_CMethodDef incompatibility (affects R_registerRoutines)
I recently noticed a change between R-3.3.3 and R-3.4.0 in the definition
of the R_CMethodDef struct.
typedef struct {
const char *name;
DL_FUNC fun;
int numArgs;
-
R_NativePrimitiveArgType *types;
- R_NativeArgStyle *styles;
-
} R_CMethodDef;
I suspect this is the reason that packages installed by R-3.4.0 and loaded
into R-3.3.3 will crash the latter if the package registers routines to be
called from .C or .Fortran:
% R-3.3.3 --quiet
> library(sp, lib.loc=c("/home/R/R-3.4.0/lib64/R/site-lib...
2012 Feb 06
1
Segfault on ".C" registration via R_CMethodDef according to 'Writing R Extensions'.
...*???
(line 24 is the point on the entry, while line 30 is the end of the overall array initialization list in C++).
If I put the type and style (unsigned int and enum) arrays separately,
the build process works just fine. E.g.
R_NativePrimitiveArgType types[] = {REALSXP, INTSXP, STRSXP, LGLSXP};
R_NativeArgStyle styles[] = { R_ARG_IN, R_ARG_IN, R_ARG_IN, R_ARG_IN };
R_CMethodDef cMethods[] = {
{"myC", (DL_FUNC) &myC, 4, types, NULL}, /* works */
{"myC2", (DL_FUNC) &myC, 4, types, style}, /* works */
{NULL, NULL, 0}
};
(Though I haven't tested th...