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
% cargo build
Compiling ffi-play v0.1.0 (file:///Users/fklock/Dev/Rust/ffi-play)
src/lib.rs:4:18: 4:33 warning: found struct without foreign-function-safe representation annotation in foreign module, consider adding a #[repr(C)] attribute to the type, #[warn(improper_ctypes)] on by default
src/lib.rs:4 fn foo(args: va_list::VaList);
^~~~~~~~~~~~~~~
At first I took this as a sign that this crate merely needs to add #[repr(C)] attribute(s) in appropriate places.
Working with va_args is always going to be very unsafe. It relies on the particular implementation of the va_* macros. I've been through the implementation and I'm pretty sure this warning is a false-positive.
Currently when I do:
I get the following message from
rustc
:At first I took this as a sign that this crate merely needs to add
#[repr(C)]
attribute(s) in appropriate places.However, eddyb on IRC pointed out that this might not suffice: https://botbot.me/mozilla/rust-internals/2016-02-16/?msg=60150124&page=4
In any case, it seems like the compiler warning is going to (perhaps rightfully) scare off users of this crate. So you may want to address it.
The text was updated successfully, but these errors were encountered: