Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Audit foreign import ccall types #653

Open
clyring opened this issue Feb 1, 2024 · 0 comments
Open

Audit foreign import ccall types #653

clyring opened this issue Feb 1, 2024 · 0 comments
Assignees
Labels

Comments

@clyring
Copy link
Member

clyring commented Feb 1, 2024

In this comment 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:

ptrdiff_t
sbs_elem_index(const void *s,
            int c,
            size_t n)
{ // ...
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.

@clyring clyring added the bug label Feb 1, 2024
@clyring clyring self-assigned this Feb 1, 2024
clyring added a commit to clyring/bytestring that referenced this issue Feb 14, 2024
See haskell#653.  A complete audit has not been done,
but let's just fix the known bug anyway.
clyring added a commit that referenced this issue Feb 15, 2024
See #653.  A complete audit has not been done,
but let's just fix the known bug anyway.
clyring added a commit that referenced this issue Feb 15, 2024
See #653.  A complete audit has not been done,
but let's just fix the known bug anyway.

(cherry picked from commit 418515e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant