我使用bindgen crate创建从Rust到C库的绑定,但我收到一大堆警告:
warning: `extern` block uses type `u128`, which is not FFI-safe
= note: 128-bit integers don't currently have a known stable ABI
针对此警告我该怎么办?我想我需要采取一些措施来解决这个问题,或者我可以忽略它吗?
添加
#![allow(improper_ctypes)]
以抑制警告。
如果您正在开发 FFI 箱子,您可能还需要以下一些其他标志。
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(improper_ctypes)]