Skip to content

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

Open
@egrimley-arm

Description

@egrimley-arm

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions