Skip to content
Back to formatted view

Raw Message

Message-ID: <1dd941090911151838j11a906bewd28de1079d68dbf5@mail.gmail.com>
Date: 2009-11-16T02:38:22Z
From: nabble.30.miller_2555 at spamgourmet.com
Subject: Segmentation faults on SEXP conversion	20)
In-Reply-To: <4B00B61A.3050601@stats.uwo.ca>

On Sun, Nov 15, 2009 at 9:16 PM, Duncan Murdoch - murdoch at stats.uwo.ca
<+nabble+miller_2555+1412c7fca2.murdoch#stats.uwo.ca at spamgourmet.com>
wrote:
>
> Sorry, I missed something else that's obvious: ?.Call needs a return value.
> ?The c function needs to include Rinternals.h, and the function needs to
> return a SEXP. ?So this works:
>
> #include <Rinternals.h>
> SEXP Rwrite() { Rprintf("[%i] %s",12,"Hi"); ?return R_NilValue; }
>
> (and your ptest function will return NULL).
>
> Duncan Murdoch

Ah - I must not have read the documentation closely enough to realize
a return value was required for external functions using the .Call
interface. By not returning anything, I think my erroneous calls were
mangling the stack heap. Thanks!

Will