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

od: remove long double #23

Merged
merged 3 commits into from
Feb 16, 2020
Merged

Conversation

chlongv
Copy link
Contributor

@chlongv chlongv commented Feb 13, 2020

Remove -t fL support for the od applet. It was anyhow non-functional as the use f128 representation was not compatible with the c representation, resulting in different results between rustybox and the classic od.

This allows to remove the f128 dependency as it is the only use of it and this should help for the cross-compilation that currently fails with f128.

Rust does not have a the equivalent of the long double c type. od would
required it to print long double. However, it does not work since the
used crate, f128, does not have the same internal representation as long
double.

Therefore, simply drop the L SIZE for float types. Only float (-t fF or
-t f) or double (-t fD) are supported.

Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
od was the only user for long double, that is dropped.

Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
@samuela
Copy link
Owner

samuela commented Feb 13, 2020

Thanks for the PR @chlongv ! It'll be great to finally be rid of f128. Curious that the f128 version was buggy... that seems like an issue with c2rust.

The CI error is my fault... I'll get that fixed ASAP.

@samuela
Copy link
Owner

samuela commented Feb 13, 2020

Ok, should be fixed in a1360f8

@chlongv
Copy link
Contributor Author

chlongv commented Feb 16, 2020

Thanks for the PR @chlongv ! It'll be great to finally be rid of f128. Curious that the f128 version was buggy... that seems like an issue with c2rust.

Have a look at this thread: rust-lang/rust-bindgen#1549

Doing some tests I have noticed the difference: with a binary 0.0 long double (confirmed with the "real" od), rustybox's od gave me nan (not a number).

Copy link
Owner

@samuela samuela left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@samuela samuela merged commit 0cc0c33 into samuela:master Feb 16, 2020
@chlongv chlongv deleted the od-remove-long-double branch February 17, 2020 07:53
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

Successfully merging this pull request may close these issues.

2 participants