Hello folks,
We noticed that for AArch64 Linux, va_list was being translated to a type that was not FFI-safe.
Whilst we aren't aware of any cases where va_list would be used by Rust, this does result in warnings appearing for some projects when built for Arm and not other architectures. Rather than try to block these functions from being translated in various crates, I thought it best to raise something here as a general solution may be better.
I suspect there is some subtle interaction with clang and the builtin va_list type for AArch64 Linux.
Input C/C++ Header
// typedefs below come from <stdarg.h>
typedef __builtin_va_list __gnuc_va_list;
typedef __builtin_va_list va_list;
int my_func(char *format, va_list args);
warning: `extern` block uses type `[u64; 4]`, which is not FFI-safe
--> test.rs:8:15
|
8 | args: va_list,
| ^^^^^^^ not FFI-safe
|
= help: consider passing a pointer to the array
= note: passing raw arrays by value is not FFI-safe
= note: `#[warn(improper_ctypes)]` on by default
Expected Results
We don't expect the warning to appear. Maybe something like this would be better?
Hello folks, We noticed that for AArch64 Linux, va_list was being translated to a type that was not FFI-safe. Whilst we aren't aware of any cases where va_list would be used by Rust, this does result in warnings appearing for some projects when built for Arm and not other architectures. Rather than try to block these functions from being translated in various crates, I thought it best to raise something here as a general solution may be better.
I suspect there is some subtle interaction with clang and the builtin va_list type for AArch64 Linux.
Input C/C++ Header
Bindgen Invocation
Actual Results
and/or
Expected Results
We don't expect the warning to appear. Maybe something like this would be better?