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
This directly cause abstacles for creating FFI bindings for function&types that uses long double. Bindgen currently choose to generate u128 for long double as a workaround(rust-lang/rust-bindgen#1391). However u128 itself is not FFI-safe(but at least better than f128), which is why warnings like this emit:
warning: `extern` block uses type `u128`, which is not FFI-safe
--> /home/donoughliu/ffmpeg_sources/rusty_ffmpeg/target/debug/build/rusty_ffmpeg-1e9d8c55b6509bde/out/binding.rs:2708:33
|
2708 | pub fn floorl(__x: u128) -> u128;
| ^^^^ not FFI-safe
|
= note: 128-bit integers don't currently have a known stable ABI
There are discussions of it in the rust-bindgen repo: rust-lang/rust-bindgen#1549. And there is no good way for us to solve this linting.
A good news is FFmpeg seems to be not using the insane long double, so theoretically we can safely filter out all the functions and types using the long double and these warnings will gone.
A bad news is bindgen haven't give us the functionality to filter out things related to primitive types.
But another good news is bindgen have a feature that can ignore specific macros and we are currently using it. So I think the feature above can be implemented. And currently we are blocked on this unimplemented primitive type filtering feature of rust-bindgen.
The text was updated successfully, but these errors were encountered:
FFmpeg includes
math.h
, which contains function&type related tolong double
.Rust once have support for
f128(long double)
support but removed it because of ABI issues with it(check https://github.com/rust-lang/meeting-minutes/blob/master/weekly-meetings/2014-06-24.md#removing-f128 and rust-lang/rust#15160 for the removal and check rust-lang/rust#54341 for the ABI issues).This directly cause abstacles for creating FFI bindings for function&types that uses
long double
. Bindgen currently choose to generateu128
forlong double
as a workaround(rust-lang/rust-bindgen#1391). Howeveru128
itself is not FFI-safe(but at least better thanf128
), which is why warnings like this emit:There are discussions of it in the
rust-bindgen
repo: rust-lang/rust-bindgen#1549. And there is no good way for us to solve this linting.A good news is FFmpeg seems to be not using the insane
long double
, so theoretically we can safely filter out all the functions and types using thelong double
and these warnings will gone.A bad news is bindgen haven't give us the functionality to filter out things related to primitive types.
But another good news is bindgen have a feature that can ignore specific macros and we are currently using it. So I think the feature above can be implemented. And currently we are blocked on this unimplemented primitive type filtering feature of
rust-bindgen
.The text was updated successfully, but these errors were encountered: