mach_o_sys fails to build on platforms where char is unsigned
- Dominant language
- Rust
- Stars
- 2
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
the [debian build daemons](https://buildd.debian.org/status/package.php?p=rust-mach-o-sys) are failing to build mach_o_sys (`rust-mach-o-sys` is the debian translation of the package name) on platforms which have an unsigned char.
The failures all look like this:
```
error[E0600]: cannot apply unary operator `-` to type `u8`
--> src/swap.rs:581:68
|
581 | pub const BIND_SPECIAL_DYLIB_FLAT_LOOKUP: ::std::os::raw::c_char = -2;
| ^^ cannot apply unary operator `-`
|
= note: unsigned values cannot be negated
```
Discussing this with people on IRC, `infinity0` observed that this looks like much of it is intended to handle a file format. If that's the case, maybe this should be `i8` (or `std::os::raw::c_schar` if you prefer that framing).
I can submit a patch if that would be useful.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at src/swap.rs:581 and inspect the other generated constants in that file that use negative values with c_char. Build mach_o_sys on a platform where char is unsigned and verify that the affected constants use a signed representation consistently and the build completes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100