[Rd] .Call not counting parameters consistently (PR#8450)

From: <murdoch_at_stats.uwo.ca>
Date: Wed 28 Dec 2005 - 19:32:19 GMT


The R_registerRoutines C function allows the number of parameters to a .Call function to be registered. For example, the tools package function md5sum() calls "Rmd5", which has been registered to require just one parameter.

But if it is called with the wrong number of parameters, only the first error gets caught:

  > library(tools)
> .Call("Rmd5",1,2,PACKAGE="tools")

Error: Incorrect number of arguments (2), expecting 1 for Rmd5
> .Call("Rmd5",1,2,PACKAGE="tools")

Error: argument 'files' must be character

This happens in Windows versions of R-patched and R-devel. Charlie Geyer was bitten by this in his fuzzyRankTests package (version 0.3), which fails check because of it on Windows, but not on Unix. I haven't done any testing on Unix.

I've traced into the do_dotcall function in src/main/dotcode.c, and I see that on the second call the "symbol.symbol.call" member is NULL, so no test is done, but I don't see why this is happening. The resolveNativeRoutine function does some strange stuff.

Duncan Murdoch



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Dec 29 06:39:38 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:35 GMT