-
-
Notifications
You must be signed in to change notification settings - Fork 219
Closed
Description
I saw this while compiling reticulate
with latest Rcpp on macOS:
In file included from python.cpp:4:
In file included from /Users/kevinushey/Library/R/4.0/library/Rcpp/include/Rcpp.h:57:
/Users/kevinushey/Library/R/4.0/library/Rcpp/include/Rcpp/DataFrame.h:136:18: warning: unused variable 'data' [-Wunused-variable]
SEXP data = Parent::get__();
^
And indeed, data
is read but never used here:
Rcpp/inst/include/Rcpp/DataFrame.h
Lines 133 to 155 in 0ba1b55
void set_type_after_push(){ | |
int max_rows = 0; | |
bool invalid_column_size = false; | |
SEXP data = Parent::get__(); | |
List::iterator it; | |
// Get the maximum number of rows | |
for (it = Parent::begin(); it != Parent::end(); ++it) { | |
if (Rf_xlength(*it) > max_rows) { | |
max_rows = Rf_xlength(*it); | |
} | |
} | |
for (it = Parent::begin(); it != Parent::end(); ++it) { | |
if (Rf_xlength(*it) == 0 || ( Rf_xlength(*it) > 1 && max_rows % Rf_xlength(*it) != 0 )) { | |
// We have a column that is not an integer fraction of the largest | |
invalid_column_size = true; | |
} | |
} | |
if (invalid_column_size) { | |
warning("Column sizes are not equal in DataFrame::push_back, object degrading to List\n"); | |
} else { | |
set__(Parent::get__()); | |
} | |
} |
Looks like it was introduced with d800e2a. I think we can just remove the offending line.
Metadata
Metadata
Assignees
Labels
No labels