SE-0495: C-compatible functions and enums

I believe this proposal is a valuable addition to Swift: Formalising @_cdecl and thereby improving C interoperability outside of ObjectiveC is a great step in the right direction. The following questions came up while reviewing the proposal.

Linkage of @c global functions

What is the linkage behaviour of a global function marked as @c? Does adding @c to a function ensure that a linkable symbol will be emitted. Will that be true also for Embedded Swift, where normally no (linkable) symbol would be emitted? That is, does @c imply (at least) @export(interface) from SE-0497?

Access Modifiers

Is @c usable with every available access modifier? If so, what is the intended behaviour of combining @c with private or fileprivate?

2 Likes