Hi all,
I'm running into CRAN check notes about std::cout being present in the Cpp code of a library I'm using.
Found ‘_ZSt4cout’, possibly from ‘std::cout’ (C++)
It looks like Rcpp is automatically redirecting the std::cout stream to Rcout, which is very handy and to my (shallow) understanding, solves the CRAN concern about where output from the package goes. However, I'm still getting the above CRAN check note.
Does anyone know if CRAN will ignore this note, or if there is a way to avoid it without modifying the library?
This issue was discussed by Watal M. Iwasaki and Dirk back in 2018 [https://lists.r-forge.r-project.org/pipermail/rcpp-devel/2018-October/010163.html], but I couldn't find anything more recent in my searches sorry.
thank you
Kassel Hingee
0405 818 479
kassel.hingee at anu.edu.au
Postdoctoral Fellow
Statistician
Part-winner of the 2022 Eureka Prize in Applied Environmental Research
[cid:043242e3-8b7c-4eb2-9967-91c068ce528f]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20230207/7ab0f4a2/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-iqfzn0d0.png
Type: image/png
Size: 11926 bytes
Desc: Outlook-iqfzn0d0.png
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20230207/7ab0f4a2/attachment-0001.png>
[Rcpp-devel] CRAN note about std::cout in shared library
2 messages · Kassel Hingee, Dirk Eddelbuettel
Hi Kassel,
On 7 February 2023 at 02:57, Kassel Hingee wrote:
| I'm running into CRAN check notes about std::cout being present in the Cpp code of a library I'm using. | | Found ‘_ZSt4cout’, possibly from ‘std::cout’ (C++) | | It looks like Rcpp is automatically redirecting the std::cout stream to Rcout, which is very handy and to my (shallow) understanding, solves the CRAN concern about where output from the package goes. However, I'm still getting the above CRAN check note. | | Does anyone know if CRAN will ignore this note, or if there is a way to avoid it without modifying the library? There are two things here. Years ago Rcpp got a clever pull request adding Rcpp::Rcout and Rcpp::Rcerr. We can (mostly) use these in lieu of std::cout and std::cerr, and output will be redirected to R's as if Rprintf() and REprintf() had been used as Writing R Extensions demands / suggests. We still benefit from that PR. So far so good. But in code you link against, you still need to ensure that that code does not use std::cout etc either! And that appears to have happened here. And more or less the only choice you have is to find where that use happens and to comment it out or alter it. There is no automated solution or magic here, sadly. Cheers, Dirk
dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org