From 57fef8f35594e5a77b2f49566efbef22ac734f19 Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Mon, 27 Nov 2023 20:43:55 -0400 Subject: [PATCH 1/3] format strings --- inst/include/cpp11/protect.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/inst/include/cpp11/protect.hpp b/inst/include/cpp11/protect.hpp index 86d7fccc..e4473e6f 100644 --- a/inst/include/cpp11/protect.hpp +++ b/inst/include/cpp11/protect.hpp @@ -279,7 +279,9 @@ static struct { void print() { static SEXP list = get_preserve_list(); for (SEXP cell = list; cell != R_NilValue; cell = CDR(cell)) { - REprintf("%x CAR: %x CDR: %x TAG: %x\n", cell, CAR(cell), CDR(cell), TAG(cell)); + REprintf("%p CAR: %p CDR: %p TAG: %p\n", reinterpret_cast(cell), + reinterpret_cast(CAR(cell)), reinterpret_cast(CDR(cell)), + reinterpret_cast(TAG(cell))); } REprintf("---\n"); } From 19b0970f3816bef14ca48668bf3b45277854e460 Mon Sep 17 00:00:00 2001 From: Davis Vaughan Date: Fri, 1 Dec 2023 11:44:53 -0500 Subject: [PATCH 2/3] Also fixup debug comments --- inst/include/cpp11/sexp.hpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/inst/include/cpp11/sexp.hpp b/inst/include/cpp11/sexp.hpp index 1517c5af..9f6f5e18 100644 --- a/inst/include/cpp11/sexp.hpp +++ b/inst/include/cpp11/sexp.hpp @@ -20,14 +20,15 @@ class sexp { sexp() = default; sexp(SEXP data) : data_(data), preserve_token_(preserved.insert(data_)) { - // REprintf("created %x %x : %i\n", data_, preserve_token_, protect_head_size()); + // REprintf("created %p %p\n", reinterpret_cast(data_), + // reinterpret_cast(preserve_token_)); } sexp(const sexp& rhs) { data_ = rhs.data_; preserve_token_ = preserved.insert(data_); - // REprintf("copied %x new protect %x : %i\n", rhs.data_, preserve_token_, - // protect_head_size()); + // REprintf("copied %p new protect %p\n", reinterpret_cast(rhs.data_), + // reinterpret_cast(preserve_token_)); } sexp(sexp&& rhs) { @@ -37,7 +38,7 @@ class sexp { rhs.data_ = R_NilValue; rhs.preserve_token_ = R_NilValue; - // REprintf("moved %x : %i\n", rhs.data_, protect_head_size()); + // REprintf("moved %p\n", reinterpret_cast(rhs.data_)); } sexp& operator=(const sexp& rhs) { @@ -45,7 +46,7 @@ class sexp { data_ = rhs.data_; preserve_token_ = preserved.insert(data_); - // REprintf("assigned %x : %i\n", rhs.data_, protect_head_size()); + // REprintf("assigned %p\n", reinterpret_cast(rhs.data_)); return *this; } From d978353c3580ef368da8dbf624bae3b14c09b181 Mon Sep 17 00:00:00 2001 From: Davis Vaughan Date: Fri, 1 Dec 2023 11:47:22 -0500 Subject: [PATCH 3/3] NEWS bullet --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/NEWS.md b/NEWS.md index 13dfa5c6..73e049bb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,8 @@ # cpp11 (development version) +* Internal changes requested by CRAN to fix invalid format string tokens + (@paleolimbot, #345). + # cpp11 0.4.6 * R >=3.5.0 is now required to use cpp11. This is in line with (and even goes