Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: extern block uses type [u64; 4], which is not FFI-safe #118

Open
egrimley-arm opened this issue Aug 22, 2023 · 0 comments
Open

Comments

@egrimley-arm
Copy link
Collaborator

In the output from the CI tests there are about ten warnings similar to this one:

   Compiling psa-crypto-sys v0.10.0 (/home/runner/work/rust-psa-crypto/rust-psa-crypto/psa-crypto-sys)
warning: `extern` block uses type `[u64; 4]`, which is not FFI-safe
 --> /home/runner/work/rust-psa-crypto/rust-psa-crypto/target/aarch64-unknown-linux-gnu/debug/build/psa-crypto-sys-0bf6a434edbfaaab/out/shim_bindings.rs:3:154378
  |
3 | ...at : * const :: std :: os :: raw :: c_char , __arg : [u64 ; 4usize]) -> :: std :: os :: raw :: c_int ; } extern "C" { pub fn vprintf (...
  |                                                         ^^^^^^^^^^^^^^ not FFI-safe
  |
  = note: `#[warn(improper_ctypes)]` on by default
  = help: consider passing a pointer to the array
  = note: passing raw arrays by value is not FFI-safe

The warnings happen when building for AArch64 and apparently relate to va_list. They are probably harmless so we don't have to do anything about it, but maybe we'll want to turn warnings into errors one day. Possible actions:

  1. Do nothing.
  2. If the functions are not used, tell bindgen not to generate bindings for those functions: is there a better way of doing that than listing all the functions somewhere in build.rs?
  3. Disable that particular warning for shim_bindings.rs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant