[BUG] `af_set_backend` is declared with the wrong parameter width
まだ誰も着手していません。
評価
調査の方向性
src/core/backend.rs:7 から始め、同じ extern ブロック内の隣接する宣言と af_set_backend を比較します。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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 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時間 初心者へのやさしさ 75/100
-
issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
web-infra-dev/rspack#15847 ·