Re: [PATCH] rust: kunit: use C-string literals to clean warning

From: Miguel Ojeda
Date: Thu Oct 03 2024 - 09:03:29 EST


On Sat, Sep 28, 2024 at 8:36 PM Gary Guo <gary@xxxxxxxxxxx> wrote:
>
> Note that the cast actually need to be re-introduced instead of
> cleaned-up -- `c"".as_ptr()` returns `core::ffi::c_char` which might be
> signed, while after my series `*const u8` is expected by `printf`.

Ah, right, in your series `bindgen` will point to the new one while
the method will return the `core::ffi` one which might be still `i8`
in some targets.

It would be nice to get a way to modify the target for `u8`, i.e.
`-Cunsigned-char` or a "target modifier" or similar.

Added an entry with some links in our `rustc` list at
https://github.com/Rust-for-Linux/linux/issues/355.

Cheers,
Miguel