feld (feld@friedcheese.us)'s status on Friday, 20-Jun-2025 05:56:22 JST
-
Embed this notice
@mischievoustomato my entire claude prompt was
When I try to compile this on aarch64, I get the following error:
error[E0308]: mismatched types
--> src/interface/unix.rs:232:28
|
232 | let nlen: i8 = (*sa).sa_data[3];
| -- ^^^^^^^^^^^^^^^^ expected `i8`, found `u8`
| |
| expected due to this
|
help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
|
232 | let nlen: i8 = (*sa).sa_data[3].try_into().unwrap();
| ++++++++++++++++++++
error[E0308]: mismatched types
--> src/interface/unix.rs:233:28
|
233 | let alen: i8 = (*sa).sa_data[4];
| -- ^^^^^^^^^^^^^^^^ expected `i8`, found `u8`
| |
| expected due to this
|
help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
|
233 | let alen: i8 = (*sa).sa_data[4].try_into().unwrap();
| ++++++++++++++++++++
For more information about this error, try `rustc --explain E0308`.
error: could not compile `netdev` (lib) due to 2 previous errors
I believe this is due to arm defining char as unsigned: @https://github.com/ARM-software/abi-aa/blob/main/aapcs64/aapcs64.rst#10arm-c-and-c-language-mappings
how would you fix this while retaining support for all the existing architectures/targets?
and like magic, it fixed it perfectly without me needing to spend a couple hours reading Rust 101