int printf(char *, ...); void other(int a, int b) { printf("a=%d b=%d\n", a, b); } int main() { // called like extern(D) ((void (*)(int, int))other)(1, 2); // Error: incompatible types for `(cast(void function(int, int))& other) is (other)`: `void function(int, int)` and `extern (C) void(int a, int b)` if (((void (*)(int, int))other) == other) {} } on 64-bit linux, the call prints "a=2 b=1" since arguments to extern(D) functions are passed in reverse order
@WalterBright created dlang/dmd pull request #14024 "fix Issue 23045 - importC: casted function type is missing extern(C)" fixing this issue: - fix Issue 23045 - importC: casted function type is missing extern(C) https://github.com/dlang/dmd/pull/14024
dlang/dmd pull request #14024 "fix Issue 23045 - importC: casted function type is missing extern(C)" was merged into master: - b989082dcd87095cc90d489172e806daf938a553 by Walter Bright: fix Issue 23045 - importC: casted function type is missing extern(C) https://github.com/dlang/dmd/pull/14024
dlang/dmd pull request #14054 "fix Issue 23045 - importC: casted function type is missing extern(C)" was merged into stable: - 9315e53dfc317d309c2398b6bd34e5b8255c228b by Walter Bright: fix Issue 23045 - importC: casted function type is missing extern(C) (#14024) https://github.com/dlang/dmd/pull/14054
dlang/dmd pull request #14064 "merge stable" was merged into master: - 84af0a8586450025d2b22ab623224d074d2ec4b8 by Walter Bright: fix Issue 23045 - importC: casted function type is missing extern(C) (#14024) https://github.com/dlang/dmd/pull/14064