@_silgen_name
is fundamentally broken for the purpose. It's unfortunate that it pretends to work in so many cases, and that it's so easy to reach for if you know it exists, but please don't. It will break. All of those places you raised in the Swift repo are misusing it too and need to be fixed. I can sympathize with the desire for an easy way to declare an external C function, but @_silgen_name
is not it, and will never be it. I would not object to someone implementing something like maybe allowing @_cdecl
to declare a function without a body and proposing that as a feature.
7 Likes