Re: [R-pkg-devel] Error handling in C code

2024-05-06 Thread Jarrod Hadfield
:38 To: Jarrod Hadfield Cc: r-package-devel@r-project.org Subject: Re: [R-pkg-devel] Error handling in C code This email was sent to you by someone outside the University. You should only click on links or attachments if you are certain that the email is genuine and the content is safe. Jarrod

Re: [R-pkg-devel] Error handling in C code

2024-05-05 Thread Simon Urbanek
Jarrod, could you point us to the code? There is not much to go by based on your email. One thing just in general: it's always safer to not re-map function names, especially since "error" can be defined in many random other headers, so it's better to use Rf_error() instead to avoid confusions w

Re: [R-pkg-devel] Error handling in C code

2024-05-03 Thread Duncan Murdoch
Most functions in R have a prefix on their name, with aliases defined so you can use the function without the prefix. But you can turn off the aliasing, in which case you need the true name. I think for all of the functions you list the prefix is "Rf_", so they are "Rf_error", etc. Perhaps y

[R-pkg-devel] Error handling in C code

2024-05-03 Thread Jarrod Hadfield
Hi, I have an R library with C code in it. It has failed the CRAN checks for Debian. The problem is with the error function being undefined. Section 6.2 of the Writing R extensions (see below) suggests error handling can be handled by error and the appropriate header file is included in R.h, b