You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(libflux): fix libflux tests on aarch64-linux (#5542)
This test uses the `c_char` type and tried to negate it. This works on
`x86_64` because `c_char` is signed, but this signedness is explicitly
_implementation-defined_ in the standard. In fact, on `aarch64-linux`,
`c_char` is unsigned, and in Rust unsigned values cannot be negated. To
work around this, we must patch over this piece of ancient esoterica by
telling the Rust compiler _exactly_ what we want to do. We specify that
the literal is an `i8`, and then explicitly cast to `c_char`. Rust
safely defines casts between signed and unsigned types to behave like
two's complement, so `aarch64` systems will interpret it as `-61 + 256 =
195`. This does not appear to break the test :).
Closes#5495
0 commit comments