Open
Description
Zig Version
0.14.0-dev.3286+05d8b565a
Steps to Reproduce and Observed Behavior
given the following code;
// v- is bad
extern const bad: fn ([]const u8) void;
pub fn main() void {
bad();
}
attempt at compilation;
❯ zig run test.zig
Error: nu::shell::terminated_by_signal
└─ mem.sliceAsBytes__anon_19529
× External command was terminated by a signal
╭─[entry #12:1:1]
1 │ zig run test2.zig
· ─┬─
· ╰── terminated by SIGSEGV (11)
╰────
Expected Behavior
expect the output to be similar to;
// v- is bad
extern fn bad([]const u8) void;
pub fn main() void {
bad();
}
which produces;
❯ zig run test2.zig
test2.zig:2:15: error: parameter of type '[]const u8' not allowed in function with calling convention 'x86_64_sysv'
extern fn bad([]const u8) void;
^~~~~~~~~~
test2.zig:2:15: note: slices have no guaranteed in-memory representation
referenced by:
main: test2.zig:4:5
posixCallMainAndExit: /nix/store/5ijjcxhqcjc96q0pkqrnh97mkxpcqvwg-zig-0.14.0-dev.3286+05d8b565a/lib/std/start.zig:647:22
4 reference(s) hidden; use '-freference-trace=6' to see all references
Activity