Closed Jarred-Sumner closed 2 weeks ago
The technical aspect of this is that the code is exporting the equivalent of
*const *const fn () callconv(.C) void
while the
extern fn exported2() void;
is expecting a
*const fn () callconv(.C) void
.
To handle that
const exported2 = @extern(*const *const fn () callconv(.C) void, .{ .name = "exported2" });
...
exported2.*();
...
This footgun should be addressed by this accepted proposal #14911
Zig Version
0.13.0
Steps to Reproduce and Observed Behavior
To reproduce:
zig test
on this file:extern fn exported2() void;
test { exported2(); }
This reproduces on macOS arm64 and Windows x64. It caused the "fuzzy-wuzzy.test.ts" test to fail in this github action run (and locally in a build with optimizations enabled).
.SysV
and.C
on Windows x64."name"
doesn't seem to matter, it happens when the name is the same as the function nameExpected Behavior
The test should pass without crashing