[BUG] `af_set_backend` is declared with the wrong parameter width
還沒有人認領這個 Issue。
評估
研究方向
從 src/core/backend.rs:7 開始,將 af_set_backend 與同一 extern 區塊中的相鄰宣告進行比較。檢查 include/af/backend.h:24 以確認 C enum 型別,然後更新 Rust 宣告使其與 ABI 相符,接著執行儲存庫的 Rust 檢查或測試。當該宣告使用正確的參數寬度且檢查通過時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
extern "C" {
fn af_set_backend(bknd: u8) -> c_int;
The C signature (include/af/backend.h:24) is:
AFAPI af_err af_set_backend(const af_backend bknd);
af_backend is a C enum, i.e. 4-byte int under both MSVC and GCC. Declaring the parameter as u8 is an ABI type mismatch.
In practice it works, because rustc emits zeroext for the u8 argument and the callee reads a clean value from the full register — I checked the IR (declare noundef i32 @af_set_backend(i8 noundef zeroext)). So this is as a latent correctness issue rather than an active bug, but it should still be c_uint to match the C ABI.
The three neighbouring declarations in the same extern block already use c_uint/c_int correctly.
Found by Claude Opus 5.
- 主要語言
- Rust
- 星號
- 827
- 分支
- 59
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
我們還沒有檢查這個專案的環境設定檔。先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
arrayfire/arrayfire-rust 的其他 Issue
-
Bug
難度 1/5 1 小時以內 新手友好度 88/100
arrayfire/arrayfire-rust#387 ·
-
Bug
難度 2/5 1-3 小時 新手友好度 78/100
arrayfire/arrayfire-rust#386 ·
-
Bug
難度 2/5 1-3 小時 新手友好度 76/100
arrayfire/arrayfire-rust#384 ·
-
Bug
難度 5/5 一週以上 新手友好度 35/100
arrayfire/arrayfire-rust#385 · 1 則留言 ·
-
Bug
難度 3/5 1-2 天 新手友好度 45/100
arrayfire/arrayfire-rust#382 ·
查看 arrayfire/arrayfire-rust 的全部 Issue
相似的 Issue
-
area:casework bug criticality:p3 triage:needs-implementation
難度 2/5 1-3 小時 新手友好度 84/100
registrystack/registry-stack#1623 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
leptos-rs/leptos#4885 · 1 則留言 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 78/100
longbridge/gpui-kit#3276 ·
維護者通常 1 天內回覆
-
A-Migration Guides D-Straightforward S-Ready-For-Implementation X-Uncontroversial
難度 1/5 1 小時以內 新手友好度 88/100
bevyengine/bevy-website#2607 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆