diff --git a/ChangeLog b/ChangeLog index f80d4f939..9b4333ac3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2026-06-28 David Seifert + + * inst/include/Rcpp/date_datetime/newDateVector.h: Explicitly default the + copy constructor (the class has a user-provided copy assignment operator) + to silence -Wdeprecated-copy-with-user-provided-copy under -Wextra + * inst/include/Rcpp/date_datetime/newDatetimeVector.h: Idem + +2026-06-28 David Seifert + + * inst/include/Rcpp/Module.h: Anonymize unused function parameters to + silence -Wunused-parameter (part of -Wextra) + * inst/include/Rcpp/Promise.h: Idem + * inst/include/Rcpp/StretchyList.h: Idem + * inst/include/Rcpp/internal/wrap.h: Idem + * inst/include/Rcpp/module/Module_Field.h: Idem + * inst/include/Rcpp/sugar/functions/cbind.h: Idem + * inst/include/Rcpp/sugar/functions/is_na.h: Idem + * inst/include/Rcpp/sugar/matrix/col.h: Idem + * inst/include/Rcpp/sugar/matrix/row.h: Idem + * inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h: Idem + * inst/include/Rcpp/sugar/tools/safe_math.h: Idem + * inst/include/Rcpp/vector/Subsetter.h: Idem + * inst/include/Rcpp/vector/Vector.h: Idem + * src/api.cpp: Idem + * inst/tinytest/cpp/InternalFunction.cpp: Idem + 2026-06-23 Jeroen Ooms * Add templated integer-index overload on platforms without diff --git a/inst/include/Rcpp/Module.h b/inst/include/Rcpp/Module.h index 7556e9f3c..dff0a6b3a 100644 --- a/inst/include/Rcpp/Module.h +++ b/inst/include/Rcpp/Module.h @@ -205,7 +205,7 @@ namespace Rcpp{ private: template - Class* get_new_impl(SEXP* args, int nargs, traits::index_sequence) { + Class* get_new_impl(SEXP* args, int /*nargs*/, traits::index_sequence) { return new Class( as(args[Is])... ) ; } }; @@ -222,7 +222,7 @@ namespace Rcpp{ class Factory : public Factory_Base { public: Factory( Class* (*fun)(T...) ) : ptr_fun(fun){} - virtual Class* get_new( SEXP* args, int nargs ){ + virtual Class* get_new( SEXP* args, int /*nargs*/ ){ return get_new( args, traits::make_index_sequence() ) ; } virtual int nargs(){ return sizeof...(T) ; } diff --git a/inst/include/Rcpp/Promise.h b/inst/include/Rcpp/Promise.h index 01bec2978..c63593242 100644 --- a/inst/include/Rcpp/Promise.h +++ b/inst/include/Rcpp/Promise.h @@ -77,7 +77,7 @@ namespace Rcpp{ return Environment( PRENV(Storage::get__() ) ) ; } - inline void update(SEXP data){} + inline void update(SEXP /*data*/){} } ; diff --git a/inst/include/Rcpp/StretchyList.h b/inst/include/Rcpp/StretchyList.h index 3a73de118..877bb8853 100644 --- a/inst/include/Rcpp/StretchyList.h +++ b/inst/include/Rcpp/StretchyList.h @@ -48,7 +48,7 @@ namespace Rcpp{ Storage::set__(r_cast(x)) ; } - void update(SEXP x){} + void update(SEXP /*x*/){} inline operator SEXP() const{ return CDR(Storage::get__() ); diff --git a/inst/include/Rcpp/date_datetime/newDateVector.h b/inst/include/Rcpp/date_datetime/newDateVector.h index 89e3138ea..031f463f2 100644 --- a/inst/include/Rcpp/date_datetime/newDateVector.h +++ b/inst/include/Rcpp/date_datetime/newDateVector.h @@ -48,6 +48,8 @@ namespace Rcpp { return v; } + newDateVector(const newDateVector&) = default; + inline newDateVector &operator=(const newDateVector &rhs) { if (this != &rhs) { NumericVector::operator=(rhs); diff --git a/inst/include/Rcpp/date_datetime/newDatetimeVector.h b/inst/include/Rcpp/date_datetime/newDatetimeVector.h index efbae149c..9b025f25f 100644 --- a/inst/include/Rcpp/date_datetime/newDatetimeVector.h +++ b/inst/include/Rcpp/date_datetime/newDatetimeVector.h @@ -56,6 +56,8 @@ namespace Rcpp { return v; } + newDatetimeVector(const newDatetimeVector&) = default; + inline newDatetimeVector &operator=(const newDatetimeVector &rhs) { if (this != &rhs) { NumericVector::operator=(rhs); diff --git a/inst/include/Rcpp/internal/wrap.h b/inst/include/Rcpp/internal/wrap.h index 4567f2455..ae020ae9c 100644 --- a/inst/include/Rcpp/internal/wrap.h +++ b/inst/include/Rcpp/internal/wrap.h @@ -522,7 +522,7 @@ namespace Rcpp { * quite a cryptic message */ template - inline SEXP wrap_dispatch_unknown_iterable(const T& object, ::Rcpp::traits::false_type) { + inline SEXP wrap_dispatch_unknown_iterable(const T& /*object*/, ::Rcpp::traits::false_type) { RCPP_DEBUG_1("wrap_dispatch_unknown_iterable<%s>(., false )", DEMANGLE(T)) // here we know that T is not convertible to SEXP static_assert(!sizeof(T), "cannot convert type to SEXP"); @@ -906,7 +906,7 @@ namespace Rcpp { template <> inline SEXP wrap(const Rcpp::String& object); template - inline SEXP module_wrap_dispatch(const T& obj, Rcpp::traits::void_wrap_tag) { + inline SEXP module_wrap_dispatch(const T& /*obj*/, Rcpp::traits::void_wrap_tag) { return R_NilValue; } diff --git a/inst/include/Rcpp/module/Module_Field.h b/inst/include/Rcpp/module/Module_Field.h index 507f5b6ca..5813c849f 100644 --- a/inst/include/Rcpp/module/Module_Field.h +++ b/inst/include/Rcpp/module/Module_Field.h @@ -54,7 +54,7 @@ class CppProperty_Getter : public CppProperty { prop_class(doc), ptr(ptr_), class_name(DEMANGLE(PROP)) {} SEXP get(Class* object) { return Rcpp::wrap( object->*ptr ) ; } - void set(Class* object, SEXP value) { throw std::range_error("read only data member") ; } + void set(Class* /*object*/, SEXP /*value*/) { throw std::range_error("read only data member") ; } bool is_readonly(){ return true ; } std::string get_class(){ return class_name; } diff --git a/inst/include/Rcpp/sugar/functions/cbind.h b/inst/include/Rcpp/sugar/functions/cbind.h index 84e5bfe4b..dd4f26713 100644 --- a/inst/include/Rcpp/sugar/functions/cbind.h +++ b/inst/include/Rcpp/sugar/functions/cbind.h @@ -151,11 +151,11 @@ class ScalarBindable inline R_xlen_t ncol() const { return 1; } - inline stored_type operator[](R_xlen_t i) const { + inline stored_type operator[](R_xlen_t /*i*/) const { return t; } - inline stored_type operator()(R_xlen_t i, R_xlen_t j) const { + inline stored_type operator()(R_xlen_t /*i*/, R_xlen_t /*j*/) const { return t; } }; @@ -443,7 +443,7 @@ inline typename Rcpp::traits::enable_if< has_stored_type::value, MakeBindableCall >::type -MakeBindable(const T& t) { +MakeBindable(const T& /*t*/) { return MakeBindableCall(); } @@ -452,7 +452,7 @@ inline typename Rcpp::traits::enable_if< !has_stored_type::value, MakeBindableCall >::type -MakeBindable(const T& t) { +MakeBindable(const T& /*t*/) { return MakeBindableCall(); } diff --git a/inst/include/Rcpp/sugar/functions/is_na.h b/inst/include/Rcpp/sugar/functions/is_na.h index 60772fc4b..7018205ff 100644 --- a/inst/include/Rcpp/sugar/functions/is_na.h +++ b/inst/include/Rcpp/sugar/functions/is_na.h @@ -55,7 +55,7 @@ class IsNa : public ::Rcpp::VectorBase< LGLSXP, false, IsN IsNa( const BASE& obj_) : obj(obj_){} - inline int operator[]( R_xlen_t i ) const { + inline int operator[]( R_xlen_t /*i*/ ) const { return FALSE ; } diff --git a/inst/include/Rcpp/sugar/matrix/col.h b/inst/include/Rcpp/sugar/matrix/col.h index 282b6d58c..451fd5068 100644 --- a/inst/include/Rcpp/sugar/matrix/col.h +++ b/inst/include/Rcpp/sugar/matrix/col.h @@ -36,7 +36,7 @@ class Col : public MatrixBase< Col( const LHS_TYPE& lhs) : nr( lhs.ncol() ), nc( lhs.ncol() ) {} - inline int operator()( int i, int j ) const { + inline int operator()( int /*i*/, int j ) const { return j + 1 ; } diff --git a/inst/include/Rcpp/sugar/matrix/row.h b/inst/include/Rcpp/sugar/matrix/row.h index 815258c8c..1337b20bf 100644 --- a/inst/include/Rcpp/sugar/matrix/row.h +++ b/inst/include/Rcpp/sugar/matrix/row.h @@ -36,7 +36,7 @@ class Row : public MatrixBase< Row( const LHS_TYPE& lhs) : nr( lhs.nrow() ), nc( lhs.ncol() ) {} - inline int operator()( int i, int j ) const { + inline int operator()( int i, int /*j*/ ) const { return i + 1 ; } diff --git a/inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h b/inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h index 365432c5f..9452a259c 100644 --- a/inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h +++ b/inst/include/Rcpp/sugar/operators/Comparator_With_One_Value.h @@ -54,7 +54,7 @@ class Comparator_With_One_Value : public ::Rcpp::VectorBase< LGLSXP, true, Compa METHOD m ; Operator op ; - inline int rhs_is_na(int i) const { return rhs ; } + inline int rhs_is_na(int /*i*/) const { return rhs ; } inline int rhs_is_not_na(int i) const { STORAGE x = lhs[i] ; return Rcpp::traits::is_na(x) ? NA_INTEGER : op( x, rhs ) ; @@ -93,7 +93,7 @@ class Comparator_With_One_Value : METHOD m ; Operator op ; - inline int rhs_is_na(int i) const { return rhs ; } + inline int rhs_is_na(int /*i*/) const { return rhs ; } inline int rhs_is_not_na(int i) const { return op( lhs[i], rhs ) ; } diff --git a/inst/include/Rcpp/sugar/tools/safe_math.h b/inst/include/Rcpp/sugar/tools/safe_math.h index 46774850d..b929bbd60 100644 --- a/inst/include/Rcpp/sugar/tools/safe_math.h +++ b/inst/include/Rcpp/sugar/tools/safe_math.h @@ -68,7 +68,7 @@ namespace detail { template inline typename std::enable_if::value, T>::type - safe_add(T a, T b, const char* caller = nullptr) { return a + b; } + safe_add(T a, T b, const char* /*caller*/ = nullptr) { return a + b; } // Subtraction template @@ -94,7 +94,7 @@ namespace detail { template inline typename std::enable_if::value, T>::type - safe_sub(T a, T b, const char* caller = nullptr) { return a - b; } + safe_sub(T a, T b, const char* /*caller*/ = nullptr) { return a - b; } // Multiplication template @@ -123,7 +123,7 @@ namespace detail { template inline typename std::enable_if::value, T>::type - safe_mul(T a, T b, const char* caller = nullptr) { return a * b; } + safe_mul(T a, T b, const char* /*caller*/ = nullptr) { return a * b; } } // namespace detail } // namespace sugar diff --git a/inst/include/Rcpp/vector/Subsetter.h b/inst/include/Rcpp/vector/Subsetter.h index 085179171..f42fbc68e 100644 --- a/inst/include/Rcpp/vector/Subsetter.h +++ b/inst/include/Rcpp/vector/Subsetter.h @@ -147,7 +147,7 @@ class SubsetProxy { #endif } - void get_indices( traits::identity< traits::int2type > t ) { + void get_indices( traits::identity< traits::int2type > /*t*/ ) { indices.reserve(rhs_n); int* ptr = INTEGER(rhs); // ok to use int * here, we'll catch any problems inside check_indices check_indices(ptr, rhs_n, lhs_n); @@ -157,7 +157,7 @@ class SubsetProxy { indices_n = rhs_n; } - void get_indices( traits::identity< traits::int2type > t ) { + void get_indices( traits::identity< traits::int2type > /*t*/ ) { indices.reserve(rhs_n); std::vector tmp(rhs.size()); // create temp R_xlen_t type indices from reals for(size_t i = 0 ; i < tmp.size() ; ++i) { @@ -170,7 +170,7 @@ class SubsetProxy { indices_n = rhs_n; } - void get_indices( traits::identity< traits::int2type > t ) { + void get_indices( traits::identity< traits::int2type > /*t*/ ) { indices.reserve(rhs_n); SEXP names = Rf_getAttrib(lhs, R_NamesSymbol); if (Rf_isNull(names)) stop("names is null"); @@ -185,7 +185,7 @@ class SubsetProxy { indices_n = indices.size(); } - void get_indices( traits::identity< traits::int2type > t ) { + void get_indices( traits::identity< traits::int2type > /*t*/ ) { indices.reserve(rhs_n); if (lhs_n != rhs_n) { stop("logical subsetting requires vectors of identical size"); diff --git a/inst/include/Rcpp/vector/Vector.h b/inst/include/Rcpp/vector/Vector.h index 6599b0e45..3312d3969 100644 --- a/inst/include/Rcpp/vector/Vector.h +++ b/inst/include/Rcpp/vector/Vector.h @@ -529,7 +529,7 @@ class Vector : } template - static void replace_element__dispatch( traits::false_type, iterator it, SEXP names, R_xlen_t index, const U& u){ + static void replace_element__dispatch( traits::false_type, iterator it, SEXP /*names*/, R_xlen_t /*index*/, const U& u){ *it = converter_type::get(u); } diff --git a/inst/tinytest/cpp/InternalFunction.cpp b/inst/tinytest/cpp/InternalFunction.cpp index 7261da9c8..049a12c03 100644 --- a/inst/tinytest/cpp/InternalFunction.cpp +++ b/inst/tinytest/cpp/InternalFunction.cpp @@ -27,7 +27,7 @@ int add(int a, int b) { return a + b; } -void dummy(int a, int b) { +void dummy(int /*a*/, int /*b*/) { Rcpp::Rcout << "dummy called" << std::endl; } diff --git a/src/api.cpp b/src/api.cpp index 723a90ccc..64fdb9b2f 100644 --- a/src/api.cpp +++ b/src/api.cpp @@ -226,7 +226,7 @@ SEXP rcpp_can_use_cxx11() { } // [[Rcpp::register]] -SEXP stack_trace(const char* file, int line) { +SEXP stack_trace(const char* /*file*/, int /*line*/) { return R_NilValue; } // #nocov end