[R] Error messages and C

Ross Boylan ross at biostat.ucsf.edu
Fri Aug 20 20:35:24 CEST 2004


I am calling a C (C++ really) function via the .C interface.
Sometimes when things go wrong I want to return an error message.

1.  R provides C functions error and warning which look about right. 
But exactly how does this exit, and in particular what happens with
cleaning up, calling C++ destructors, and unwinding the stack?  Will I
get memory leaks?

2.  Before I discovered those functions, I looked at passing in a
character vector as an argument, char ** p in the C code.  Exactly how
do I use these things?  Am I supposed to allocate a string and stuff the
pointer in the function argument?  Or should I assume *p points to valid
space (how much?) and fill it in?

Thanks.
-- 
Ross Boylan                                      wk:  (415) 502-4031
530 Parnassus Avenue (Library) rm 115-4          ross at biostat.ucsf.edu
Dept of Epidemiology and Biostatistics           fax: (415) 476-9856
University of California, San Francisco
San Francisco, CA 94143-0840                     hm:  (415) 550-1062




More information about the R-help mailing list