r-lib / cpp11

cpp11 helps you to interact with R objects using C++ code.
https://cpp11.r-lib.org/
Other
200 stars 46 forks source link

Dev version of cpp11 has rchk warnings #225

Closed nealrichardson closed 3 years ago

nealrichardson commented 3 years ago

We run rchk on arrow, and while testing #223 in arrow, we saw these rchk warnings:

Function cpp11::attribute_proxy<cpp11::writable::r_vector<cpp11::r_string> >::operator SEXPREC*() const
  [UP] ignoring variable <unnamed var:   %4 = alloca %struct.SEXPREC*, align 8> as it has address taken, results will be incomplete 

Function cpp11::detail::get_should_unwind_protect()
  [UP] allocating function cpp11::detail::set_option(SEXPREC*, SEXPREC*)(S:cpp11_should_unwind_protect,V) may destroy its unprotected argument (should_unwind_protect_sexp <arg 2>), which is later used. /rchk/packages/build/8zFeMGLV/arrow/src/../inst/include/cpp11/protect.hpp:64
  [UP] calling allocating function cpp11::detail::set_option(SEXPREC*, SEXPREC*)(S:cpp11_should_unwind_protect,V) with a fresh pointer (should_unwind_protect_sexp <arg 2>) /rchk/packages/build/8zFeMGLV/arrow/src/../inst/include/cpp11/protect.hpp:64

See https://github.com/ursacomputing/crossbow/runs/3302756923?check_suite_focus=true

When we cherry-picked the changes from that PR onto the v0.3.1 tag, the rchk failure is resolved (and we of course don't see it on our nightly tests, which use the released version).

I don't know how to fix the issue myself, but I/we would be happy to help set up rchk tests on cpp11's CI if that would be of interest.