From nabble.30.miller_2555 at spamgourmet.com  Mon Nov 16 03:38:22 2009
From: nabble.30.miller_2555 at spamgourmet.com (nabble.30.miller_2555 at spamgourmet.com)
Date: Sun, 15 Nov 2009 21:38:22 -0500
Subject: [Rd] Segmentation faults on SEXP conversion	20)
In-Reply-To: <4B00B61A.3050601@stats.uwo.ca>
References: <1dd941090911151725w31deb09y354e968b5326c947@mail.gmail.com>
	<4B00B61A.3050601@stats.uwo.ca>
Message-ID: <1dd941090911151838j11a906bewd28de1079d68dbf5@mail.gmail.com>

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



[Rd] Segmentation faults on SEXP conversion 20)
nabble.30.miller_2555 at spamgourmet.com