haskell / haskell/bytestring

Audit `foreign import ccall` types

オープン
#653 コメント 0 件 リアクション 0 件 担当者 1 名 @clyring が担当を希望しています GitHub で見る
bug
主要言語
Haskell
スター
301
フォーク
144
平均マージ
7日 22時間
マージ済み PR(30日)
1

説明

In [this comment](https://github.com/haskell/bytestring/pull/631#discussion_r1451112873) it was noticed that we have a mismatch between the actual C prototype of `sbs_elem_index` and the foreign import in our Haskell code:

```c
ptrdiff_t
sbs_elem_index(const void *s,
int c,
size_t n)
{ // ...
```

```haskell
foreign import ccall unsafe "static sbs_elem_index"
c_elem_index :: ByteArray# -> Word8 -> CSize -> IO CPtrdiff
```

Notice that for the second argument we have `Word8` on the Haskell side and `int` on the C side.

I will audit our foreign imports for similar mistakes.

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。