Skip to content

Fix build on architectures where char is unsigned #12

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

cho-m
Copy link

@cho-m cho-m commented Apr 14, 2025

When building on aarch64 (armv8-a) Linux (GitHub's ubuntu-22.04-arm runner and local VM), there was a build failure:

   Compiling ipc v0.0.1 (https://github.com/octobuild/ipc-rs#e8d76ee3)
error[E0308]: mismatched types
   --> /home/linuxbrew/.cache/Homebrew/cargo_cache/git/checkouts/ipc-rs-a7ac1f2a1bbcf2f1/e8d76ee/src/unix.rs:156:13
    |
155 |         let fd = libc::open(
    |                  ---------- arguments to this function are incorrect
156 |             filename.as_ptr() as *const i8,
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `*const u8`, found `*const i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

This seems due to how some platforms can define char as unsigned.

libc seems to take this into account via the libc::c_char:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant