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

Auto generation Warnings & Invalid C++ Identifiers (Closes #526 and #387) #528

Merged
merged 7 commits into from
Aug 3, 2016
Merged

Auto generation Warnings & Invalid C++ Identifiers (Closes #526 and #387) #528

merged 7 commits into from
Aug 3, 2016

Conversation

coatless
Copy link
Contributor

@coatless coatless commented Aug 2, 2016

Added Autogeneration Warnings & Invalid C++ Identifiers (Closes #526 and #387)

@coatless coatless changed the title Autogeneration warning Auto generation Warnings & Invalid C++ Identifiers (Closes #526 and #387) Aug 2, 2016
<< std::endl;
if (!function.type().isVoid()) {
ostr() << " return Rcpp::as<" << function.type() << " >"
<< "(__result);" << std::endl;
<< "(RCPP_result_gen_);" << std::endl;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say drop the trailing underscore as this convention is used elsewhere (e.g. in the attributes implementation) to indicate a C++ member variable.

@eddelbuettel
Copy link
Member

We now have a merge conflict. Do you want to / have time to work through it? Else I can merge it manually later bu then you don't get the glory ...

@eddelbuettel
Copy link
Member

Will merge this as nobody cried foul ...

@eddelbuettel eddelbuettel merged commit d18a0bc into RcppCore:master Aug 3, 2016
@ghost
Copy link

ghost commented Sep 2, 2016

Hi, might I suggest to drop the leading underscore at all? So instead of writing:

    return "_RCPP_" + packageCpp() + "_RCPPEXPORTS_H_GEN_";
    ...
    return "_RCPP_" + packageCpp() + "_H_GEN_";

just write:

  return "RCPP_" + packageCpp() + "_RCPPEXPORTS_H_GEN_";
  ...
  return "RCPP_" + packageCpp() + "_H_GEN_";

See our discussion on stackoverflow: http://stackoverflow.com/questions/39291133/how-to-change-header-include-guards-in-rcpp-interfaces/39291326#39291326 and http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier/228797#228797

All identifiers that begin with an underscore and either an uppercase letter or another underscore are always reserved for any use.

Best,
Simon

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

Successfully merging this pull request may close these issues.

None yet

3 participants