Commit 41f2dba
committed
P1: fix Zig FFI to compile under Zig 0.14.0
The Zig FFI layer failed to compile under Zig 0.14.0 with four
"pointless discard of function parameter" errors in
halideiser_execute_pipeline (src/interface/ffi/src/main.zig).
The parameters input_ptr, output_ptr, input_len, and output_len are
already read by the null-pointer and zero-length validation checks
earlier in the function body. Zig 0.14 rejects `_ = param;` discards of
parameters that are genuinely used elsewhere, so the four trailing
discards were redundant and erroneous. Removed them (replaced with an
explanatory comment); the unrelated discards in halideiser_autotune
stay, as max_trials/timeout_ms are genuinely unused there.
No other errors surfaced once the discards were removed.
ABI preserved: every C:<name> in Foreign.idr still maps to an
`export fn`, and the Result enum integer values (ok=0 .. dimension_
mismatch=7) are unchanged and continue to match resultToInt in Types.idr.
Verification:
- zig test src/interface/ffi/src/main.zig -lc -> all 9 tests pass
- idris2 --build halideiser-abi.ipkg -> exit 0
Only files under src/interface/ffi/ were changed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xMKB3T4Vo5FYC7Czx3JSH1 parent 2508b29 commit 41f2dba
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
| 427 | + | |
| 428 | + | |
431 | 429 | | |
432 | 430 | | |
433 | 431 | | |
| |||
0 commit comments