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
The problem is that long double is not supported by Rust on most targets. On some targets it is equivalent to a double, however it is also a f80 on x86(_64) and f128 on a variety of platforms. f128 is available in nightly, but I do not think there are any concrete plans for a f80 in Rust.
This makes it a little tricky and potentially error prone to test for long double support properly, and there are no tests using it at the moment. I am not sure what the best way to handle long double in a Rust project is.
Should long double be included in libffi-rs at all? Or should it perhaps be available only in the raw and low modules due to the lack of native Rust support for the type? I am not saying that any of these are the correct answer, perhaps it is best to keep it as it is now, but I think it is worth to consider this.
If long double is kept, should there be tests for it on targets where this is possible? This does require some extra maintenance to make sure that tests are kept up-to-date and accurately tests for long double support where possible. The alternative is to keep it as it is today, available but not tested, requiring users of libffi-rs to perform their own tests to make sure it works. Searching GitHub, there does not seem to be a lot of use of long double with libffi-rs, which is not strange since the type is not generally supported by Rust.
The text was updated successfully, but these errors were encountered:
I think that it is a good idea to keep the long double at the raw/low levels only, in general. Long double is f64 on arm and c_double on windows. I’d prefer just to not support f80/f128 long double for now. If f128 gets stabilized (it is rather close from what I know) then we could add support for that as well. Testing would be much simpler if we keep it this way.
I created a pull request to enable
long double
on all targets as along double
type has been defined for all targets since libffi v3.4.6. However, I have some questions on howlong double
s should be handled for this project, so thought it best to open an issue.The problem is that
long double
is not supported by Rust on most targets. On some targets it is equivalent to adouble
, however it is also af80
on x86(_64) andf128
on a variety of platforms.f128
is available in nightly, but I do not think there are any concrete plans for af80
in Rust.This makes it a little tricky and potentially error prone to test for
long double
support properly, and there are no tests using it at the moment. I am not sure what the best way to handlelong double
in a Rust project is.Should
long double
be included in libffi-rs at all? Or should it perhaps be available only in theraw
andlow
modules due to the lack of native Rust support for the type? I am not saying that any of these are the correct answer, perhaps it is best to keep it as it is now, but I think it is worth to consider this.If
long double
is kept, should there be tests for it on targets where this is possible? This does require some extra maintenance to make sure that tests are kept up-to-date and accurately tests forlong double
support where possible. The alternative is to keep it as it is today, available but not tested, requiring users of libffi-rs to perform their own tests to make sure it works. Searching GitHub, there does not seem to be a lot of use oflong double
with libffi-rs, which is not strange since the type is not generally supported by Rust.The text was updated successfully, but these errors were encountered: