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

Functions with C++ return type are `extern "C"` #1839

Open
kaeptmblaubaer1000 opened this Issue Aug 24, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@kaeptmblaubaer1000

kaeptmblaubaer1000 commented Aug 24, 2017

Thats a C++ compiler error.
All functions with C++ in their signatures should be extern "C++".

@kaeptmblaubaer1000

This comment has been minimized.

Show comment
Hide comment
@kaeptmblaubaer1000

kaeptmblaubaer1000 Sep 1, 2017

The whole error only exists when the function is public.

kaeptmblaubaer1000 commented Sep 1, 2017

The whole error only exists when the function is public.

@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Sep 6, 2017

Contributor

I've never come across "extern C++", so I'm probably the wrong person to review this, but I'd be happy to see a pull request that contains a test showing what goes wrong here, and preferably even adds a fix.

To write a test, look at the .srctree files under /tests/run/, e.g. this one:
https://github.com/cython/cython/blob/master/tests/run/cpp_assignment_overload.srctree
They are basically a bunch of separate files, separated by marker lines.

Contributor

scoder commented Sep 6, 2017

I've never come across "extern C++", so I'm probably the wrong person to review this, but I'd be happy to see a pull request that contains a test showing what goes wrong here, and preferably even adds a fix.

To write a test, look at the .srctree files under /tests/run/, e.g. this one:
https://github.com/cython/cython/blob/master/tests/run/cpp_assignment_overload.srctree
They are basically a bunch of separate files, separated by marker lines.

@kaeptmblaubaer1000

This comment has been minimized.

Show comment
Hide comment
@kaeptmblaubaer1000

kaeptmblaubaer1000 Oct 15, 2017

In C++, extern "C++" is the default, but in this case, Cython overrides it with extern "C".

kaeptmblaubaer1000 commented Oct 15, 2017

In C++, extern "C++" is the default, but in this case, Cython overrides it with extern "C".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment