Skip to content

Fix compilation errors on platforms with unsigned c_char#1

Open
refi64 wants to merge 1 commit into
rustutils:masterfrom
refi64:wip/refi64/fix-arm64
Open

Fix compilation errors on platforms with unsigned c_char#1
refi64 wants to merge 1 commit into
rustutils:masterfrom
refi64:wip/refi64/fix-arm64

Conversation

@refi64
Copy link
Copy Markdown

@refi64 refi64 commented Apr 17, 2026

The docs for c_char mention:

On modern architectures this type will always be either i8 or u8

It's u8 specifically on multiple prominent architectures, such as arm64 and riscv:

https://github.com/rust-lang/rust/blob/f29256dd1420dc681bf4956e3012ffe9eccdc7e7/library/core/src/ffi/primitives.rs#L42

Thus, this updates the places where c_char is intermixed with i8 to exclusively rely on the former.

@refi64
Copy link
Copy Markdown
Author

refi64 commented Apr 17, 2026

I must note that I'm not really familiar with btrfs and thus didn't really test this past compilation. I expect it should work, because nothing really major changed, but still! This project is just a dependency of something else I had to build on an arm64 host system.

The docs for `c_char` mention:

> On modern architectures this type will always be either `i8` or `u8`

It's `u8` specifically on multiple prominent architectures, such as
arm64 and riscv:

https://github.com/rust-lang/rust/blob/f29256dd1420dc681bf4956e3012ffe9eccdc7e7/library/core/src/ffi/primitives.rs#L42

Thus, this updates the places where `c_char` is intermixed with `i8` to
exclusively rely on the former.

Signed-off-by: Ryan Gonzalez <ryan.gonzalez@collabora.com>
@refi64 refi64 force-pushed the wip/refi64/fix-arm64 branch from c0ddbb2 to 73de2cf Compare April 17, 2026 21:29
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