[R-pkg-devel] "Writing R Extensions" manual needs update [was: Error handling in C code]

Agner Fog @gner @end|ng |rom @gner@org
Mon Jun 24 09:45:18 CEST 2024


On 24/06/2024 08.56, Tomas Kalibera wrote:
>
> In principle it is the NEWS file that gives hints about important 
> changes and then one can find the details in Writing R Extensions.  
> The NEWS file as of mid-April says that "R CMD check --as-cran" will 
> compile C++ code with -DR_NO_REMAP. And then in Writing R Extensions, 
> one can read about what is R_NO_REMAP and that this has been planned 
> to become the default in the future. It is an important thing to do 
> for the maintainability of the package space: the situation with name 
> clashes with system headers (typically appearing just on some 
> platforms) has only been getting worse.
>
Thanks, but I couldn't find it when I searched for help, and I still 
can't find the news you are mentioning. The "Writing R Extensions" guide 
does not list the required Rf_ function names. This manual definitely 
has to be changed.

I predict chaos when you add R_NO_REMAP to the Windows compilation: A 
large number of old packages containing C++ code will fail. Mails will 
be sent to the maintainers. Some maintainers will be uncontactable. Some 
packages are maintained by somebody less competent than the original 
programmers. Some maintainers will be too busy to react, or they have 
forgotten how to submit a package. You will be bombarded with help 
requests. In the end, somebody will have to help update the packages 
when the maintainers fail to do so.

This mess is a consequence of a bad decision many years ago when 
somebody used non-unique function names like "error" and "warning". But 
the world looked very different back then, and now we are facing the 
consequences.

It would be useful to do a test to see how many packages need to be 
changed.

- Agner



More information about the R-package-devel mailing list