Skip to content
Prev 34891 / 63424 Next

Segmentation faults on SEXP conversion

nabble.30.miller_2555 at spamgourmet.com wrote:
And that is your clue.

C routines that are invoked via .Call() _must_
return a SEXP object. Your routine (Rwrite)
has a return type of void.  Since you use .Call(),
takes the return value from the stack and it is garbage.
Seg fault ensues.

Declare your Rwrite() routine to return a SEXP
and have it return the symbol R_NilValue, i.e.

 SEXP Rwrite() { printf("[%i] %s",12,"Hi"); return(R_NilValue); }

and you can use .Call()


  D.


 D.