Skip to content

Add strtof for all platforms that have strtod #2358

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

Merged
merged 1 commit into from
Aug 24, 2021
Merged

Add strtof for all platforms that have strtod #2358

merged 1 commit into from
Aug 24, 2021

Conversation

hcsch
Copy link

@hcsch hcsch commented Aug 22, 2021

All platforms that have strtod very likely also have strtof. Having strtof allows for fuzzing of hexf-parse::parse_hexf32 comparing against strtof, which can't (easily) be done with strtod, due to float rounding and over-/underflow behavior.

I'm unsure of whether the strtof declaration in src/unix/mod.rs also needs a link name adjustment for x86 macos. I haven't been able to find anything about this after a rough search in this repo and on Google. I haven't added it for now since only strtod (edit: out of the strtoX functions) seems to have the changed link name (and I don't have a mac handy to test the available symbols with), but feel free to tell me if it's needed and I'll adjust the PR accordingly.

Verified

This commit was signed with the committer’s verified signature.
haoqunjiang Haoqun Jiang
All platforms that have `strtod` very likely also have `strtof`. Having
`strtof` allows for fuzzing of `hexf-parse::parse_hexf32` comparing
against `strtof`, which can't (easily) be done with `strtod`, due to
float rounding and over-/underflow behavior.
@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @JohnTitor (or someone else) soon.

Please see the contribution instructions for more information.

@JohnTitor
Copy link
Member

Looks good, thanks!
@bors r+

@bors
Copy link
Contributor

bors commented Aug 24, 2021

📌 Commit f0dd7a9 has been approved by JohnTitor

@bors
Copy link
Contributor

bors commented Aug 24, 2021

⌛ Testing commit f0dd7a9 with merge 72fdbd8...

@hcsch
Copy link
Author

hcsch commented Aug 24, 2021

Should I open a version bump PR after this or is one upcoming already? I'd like to use strtof for the mentioned use case of fuzzing hexf-parse while comparing against it. (edit: I've created a PR, see #2361)

@bors
Copy link
Contributor

bors commented Aug 24, 2021

☀️ Test successful - checks-actions, checks-cirrus-freebsd-11, checks-cirrus-freebsd-12, checks-cirrus-freebsd-13
Approved by: JohnTitor
Pushing 72fdbd8 to master...

@bors bors merged commit 72fdbd8 into rust-lang:master Aug 24, 2021
@hcsch hcsch deleted the add-strtof branch August 24, 2021 07:31
@hcsch hcsch mentioned this pull request Aug 24, 2021
bors added a commit that referenced this pull request Aug 25, 2021

Verified

This commit was signed with the committer’s verified signature.
haoqunjiang Haoqun Jiang
Bump to 0.2.101

New release to allow for usage of `strtof` introduced in #2358 for
fuzzing of `hexf-parse` while comparing against `strtof` results.
bors added a commit that referenced this pull request Aug 25, 2021

Verified

This commit was signed with the committer’s verified signature.
haoqunjiang Haoqun Jiang
Bump to 0.2.101

New release to allow for usage of `strtof` introduced in #2358 for
fuzzing of `hexf-parse` while comparing against `strtof` results.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants