zig
zig copied to clipboard
error: @bitCast size mismatch: destination type 'usize' has 64 bits but source type 'c_long' has 32 bits
Zig Version
0.12.0-dev.3+9c05810be
Steps to Reproduce and Observed Behavior
git clone https://github.com/kora-org/headstartzig build -Darch=riscv64- This error should pop up:
zig build-exe headstart Debug riscv64-uefi-msvc: error: the following command failed with 1 compilation errors:
C:\Users\User\AppData\Local\Microsoft\WinGet\Packages\zig.zig.nightly_Microsoft.Winget.Source_8wekyb3d8bbwe\zig-windows-x86_64-0.12.0-dev.3+9c05810be\zig.exe build-exe D:\Azzam\kora\headstart\src\main.zig -cflags -ffreestanding -nostdlib -mno-red-zone -- D:\Azzam\kora\headstart\external\flanterm\flanterm.c D:\Azzam\kora\headstart\external\flanterm\backends\fb.c --cache-dir D:\Azzam\kora\headstart\zig-cache --global-cache-dir C:\Users\User\AppData\Local\zig --name headstart -mcmodel medium -target riscv64-uefi-msvc -mcpu baseline_rv64 --mod build_options::D:\Azzam\kora\headstart\zig-cache\c\617d0a7ef579f0c5c8f720583a81a2fe\options.zig --deps build_options -I D:\Azzam\kora\headstart\external --listen=-
Build Summary: 1/6 steps succeeded; 1 failed (disable with --summary none)
run transitive failure
└─ run sh transitive failure
└─ install transitive failure
└─ install headstart transitive failure
└─ zig build-exe headstart Debug riscv64-uefi-msvc 1 errors
D:\Azzam\kora\headstart\zig-cache\o\ba881674b31c5b5c615cc912c8122d92\cimport.zig:207:175: error: @bitCast size mismatch: destination type 'usize' has 64 bits but source type 'c_long' has 32 bits
return flanterm_fb_init(null, null, framebuffer, width, height, pitch, null, null, null, null, null, null, null, @as(?*anyopaque, @ptrFromInt(@as(c_int, 0))), @as(usize, @bitCast(@as(c_long, @as(c_int, 0)))), @as(usize, @bitCast(@as(c_long, @as(c_int, 0)))), @as(usize, @bitCast(@as(c_long, @as(c_int, 1)))), @as(usize, @bitCast(@as(c_long, @as(c_int, 1)))), @as(usize, @bitCast(@as(c_long, @as(c_int, 1)))), @as(usize, @bitCast(@as(c_long, @as(c_int, 0)))));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
referenced by:
init: src\console\flanterm.zig:11:16
main: src\main.zig:25:12
remaining reference traces hidden; use '-freference-trace' to see all reference traces
Expected Behavior
It should compiles fine like in x86_64 and aarch64.