[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
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 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
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 74/100
ontola/atomic-server#1625 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
VirusTotal/yara-x#777 ·
-
难度 2/5 1-3 小时 新手友好度 82/100
stratum-mining/stratum#2404 ·
-
bug ci good first issue
难度 2/5 1-3 小时 新手友好度 88/100