Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong empty return in Attributes.R ? #588

Closed
eddelbuettel opened this issue Nov 13, 2016 · 0 comments
Closed

Wrong empty return in Attributes.R ? #588

eddelbuettel opened this issue Nov 13, 2016 · 0 comments

Comments

@eddelbuettel
Copy link
Member

eddelbuettel commented Nov 13, 2016

@dmurdoch just sent a mass email to maintainers:

To maintainers of a number of CRAN packages:

I just did a search through CRAN source code for possible problems in the use
of return() in R packages. Unlike C, in R return() is a function; if you have
code like

if (condition) return;

the function won't be called, so execution will continue to the next line.

Your packages appear to have some instances of that usage, shown below. Some
of these may be false positives (e.g. you used "return" as a local variable
name), but I think most of them are bugs. Please take a look,
and if changes are needed, submit a revised version to CRAN.

and further down has this snippet:

./Rcpp/R/Attributes.R : 620 if (is.null(value) || !nzchar(value))
./Rcpp/R/Attributes.R : 621 return;

I think he got us. The full segment is here and I think we should indeed make that return(NULL).

PR coming in a moment.

jjallaire added a commit that referenced this issue Nov 13, 2016
correct empty return call (closes #588)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant