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

SEXP vs. void * #351

Closed
krlmlr opened this issue Jan 27, 2024 · 1 comment
Closed

SEXP vs. void * #351

krlmlr opened this issue Jan 27, 2024 · 1 comment

Comments

@krlmlr
Copy link
Member

krlmlr commented Jan 27, 2024

At some point, tools::package_native_routine_registration_skeleton() changed the generated prototypes to void * from SEXP . I couldn't find a NEWS entry.

This has implications when the function's definition lives in a C++ file with extern "C" and uses SEXP, and (apparently) SEXP means something other than void * in that translation unit. My igraph 2.0.0 release came back with an LTO error (-Wodr) because of this mismatch, fixed with igraph/rigraph@9dc6ba4.

I agree that this is a corner case of a corner case, and the solution is simple. I'm still confused why the change to void * happened. I wonder if maybe cpp11 should do something about it, and again, the answer is likely "no".

@krlmlr
Copy link
Member Author

krlmlr commented Jan 31, 2024

Bottom line:

  • For C++ code, work around by relying on [[ cpp11::register ]]
  • For C code, the discrepancy between void* and SEXP doesn't seem to matter (yet)

@krlmlr krlmlr closed this as completed Jan 31, 2024
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