Skip to content

Fix invalid C++ identifiers #387

@klmr

Description

@klmr

Rcpp uses __ as a prefix for identifiers in auto-generated code (e.g. here and here). This is problematic, since __ is not not valid in C++ identifiers (it’s reserved for use by the compiler).

Such identifiers are for instance used by standard library implementations. And although most modern implementations try to avoid aggravating users, and so use more explicit conventions in their macro names, a simple grep through the libc++ implementation shows a few macros with names such as __need_size_t (and more in libstdc++), so it’s not unthinkable that there might be conflicts with future versions of some compilers.

It would be better to replace these instances with a legal identifier token, e.g. Rcpp_.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions