Simon Anders
2010-Jan-06 15:26 UTC
[Rd] R_ext manual: type cast in C function registration
Hi,
the "Writing R extensions" manual currently advises to register a
.Call
function as follows:
R_CallMethodDef callMethods[] = {
{"myCall", &myCall, 3},
{NULL, NULL, 0}
};
This produces a compiler warning, at least on my GCC, because the second
slot in the R_CallMethodDef is declared as DL_FUNC (which is declared as
'typedef void * (*DL_FUNC)();').
I'd suggest to change the example code in the manual to include an
explicit cast, i.e.,
R_CallMethodDef callMethods[] = {
{"myCall", (DL_FUNC) &myCall, 3},
{NULL, NULL, 0}
};
in order to get rid of an unnecessary compiler warning.
Cheers
Simon
+---
| Dr. Simon Anders, Dipl.-Phys.
| European Molecular Biology Laboratory (EMBL), Heidelberg
| office phone +49-6221-387-8632
| preferred (permanent) e-mail: sanders at fs.tum.de