extern(C) names are being mangled; that's crazy, Walter says I'm crazy

Manu turkeyman at gmail.com
Fri Jul 26 21:34:29 UTC 2019


On Fri, Jul 26, 2019 at 6:00 AM Patrick Schluter via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
>
> On Wednesday, 24 July 2019 at 23:05:33 UTC, Walter Bright wrote:
> > On 7/24/2019 2:24 PM, Manu wrote:
> >> In that callback case, they're effectively anonymously named
> >> functions...
> >
> > Yet they are given a name, and extern(C) to get the right
> > calling convention.
>
> I think the issue here is one of definitions and I think I
> understand why Walter and Manu do not understand each others
> point.
>
> For Manu  extern(?) is mostly about mangling and secondarily
> about calling convention.
> For Walter, its first and foremost about calling convention. The
> mangling being unimportant as it can be explicitly set with
> mangle.
>
> When looking at what the specs says [1] it's clear that extern is
> more about calling conventions than mangling
>
> [1]: https://dlang.org/spec/attribute.html#linkage

I'm pretty sure it's about both... you can't separate them and still
be the thing that's written on the tin.
It's highly surprising, and I raise the issue as important having
recently witnessed multiple people being surprised and unimpressed
with this particular quirk. I've talked a lot about tidying up weird
shit that makes bad impressions; I'm getting tired of too many little
things adding up this way, and making it really hard for me to get
colleagues invested and build confidence, this is one such thing.


More information about the Digitalmars-d mailing list