zig translate-c Type Propagation Error for Nullable Pointer ([*c]) Dereferencing and Address Calculation in Zig #22045
Labels
bug
Observed behavior contradicts documented or intended behavior
translate-c
C to Zig source translation feature (@cImport)
Zig Version
0.14.0-dev.2064+b5cafe223
Steps to Reproduce and Observed Behavior
Input C Code
Translated zig code
zig build failure
The generated zig code incorrectly uses a cast that results in a
comptime_int
type mismatch, making it impossible to modify the array elements as intended.Expected Behavior
The
zig translate-c
tool should generate the correct zig code that allows accessing and modifying array elements through a pointer. For example, the output zig code should correctly handle the array pointer and allow the assignment.The text was updated successfully, but these errors were encountered: