Skip to content

Add swiftcc attribute to swift_retain to resolve signature mismatch issue #226

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

Merged
merged 1 commit into from
Jan 3, 2021

Conversation

kateinoigakukun
Copy link
Member

This issue was revealed while upgrading clang version in swiftwasm/swift#2410

The swift_retain has been attributed with swiftcc since
swiftwasm/swift@b565d02

Ideally the swiftcc attribute should be removed and swift side caller
should call it with C calling convention, but there is no way to declare
C function signature in Swift (except for importing from ClangImporter).

So this patch is a temporary workaround. Please follow the related forum
thread https://forums.swift.org/t/formalizing-cdecl/40677

…match issue

The swift_retain has been attributed with swiftcc since
swiftwasm/swift@b565d02

Ideally the swiftcc attribute should be removed and swift side caller
should call it with C calling convention, but there is no way to declare
C function signature in Swift (except for importing from ClangImporter).

So this patch is a temporary workaround. Please follow the related forum
thread https://forums.swift.org/t/formalizing-cdecl/40677
Copy link

@MaxDesiatov MaxDesiatov left a comment

Choose a reason for hiding this comment

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

Seems legit 👍

@kateinoigakukun kateinoigakukun merged commit a2e07b6 into swiftwasm Jan 3, 2021
@kateinoigakukun kateinoigakukun deleted the katei/compile-with-latest-clang branch January 3, 2021 11:22
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.

2 participants