[Issue 19461] New: Function literals can't be extern(C)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Dec 3 10:20:55 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19461

          Issue ID: 19461
           Summary: Function literals can't be extern(C)
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: atila.neves at gmail.com

https://dlang.org/spec/expression.html#function_literals

Unfortunately, they can't be extern(C), and if attempted there is no compiler
or linker error to warn the user about the ABI incompatilibity. Using the
parameters just won't work and there's no way to fix it.

This shows up in, say, attempting to use function literals as the function
pointer value for a Python extension implemented in D. An extern(C) function
has to be written/generated just to fix the ABI of calling it.

--


More information about the Digitalmars-d-bugs mailing list