Files
zig/test/cases/compile_errors/extern_function_pointer_mismatch.zig
mlugg 4be0cf30fc test: update for CallingConvention changes
This also includes some compiler and std changes to correct error
messages which weren't properly updated before.
2024-10-19 19:15:23 +01:00

21 lines
446 B
Zig

const fns = [_](fn (i32) i32){ a, b, c };
pub fn a(x: i32) i32 {
return x + 0;
}
pub fn b(x: i32) i32 {
return x + 1;
}
export fn c(x: i32) i32 {
return x + 2;
}
export fn entry() usize {
return @sizeOf(@TypeOf(fns));
}
// error
// target=x86_64-linux
//
// :1:38: error: expected type 'fn (i32) i32', found 'fn (i32) callconv(.c) i32'
// :1:38: note: calling convention 'x86_64_sysv' cannot cast into calling convention 'auto'