Skip to content

[test][stdlib] Add strto*_l stubs for OpenBSD. #32395

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
Jun 24, 2020

Conversation

3405691582
Copy link
Member

The template defined for Cygwin and friends does not handle failure cases
properly so the NumericParsing unit test fails. To get the correct test
behavior, we need to use an implementation such as like in the Windows
specializations or the non-Cygwin implementation that takes a function
pointer.

However, adding additional specializations would be too wordy, and
OpenBSD doesn't have locale-dependent definitions of the relevant strto*
functions. We could add a specialization for a two-argument function
pointer, but that becomes too repetitive.

Instead, implement a few stubs and use the preprocessor, a la the
implementation for Android.

The template defined for Cygwin and friends does not handle failure cases
properly so the NumericParsing unit test fails.  To get the correct test
behavior, we need to use an implementation such as like in the Windows
specializations or the non-Cygwin implementation that takes a function
pointer.

However, adding additional specializations would be too wordy, and
OpenBSD doesn't have locale-dependent definitions of the relevant strto*
functions. We could add a specialization for a two-argument function
pointer, but that becomes too repetitive.

Instead, implement a few stubs and use the preprocessor, a la the
implementation for Android.
@compnerd
Copy link
Member

Hmm, do you think its worth trying to unify the Android and OpenBSD paths?

@3405691582
Copy link
Member Author

I think there's a lot of scope for cleanup here, especially as well as how that _WIN32 branch does a lot of what the generic function pointer interface does.

Happy to take a stab at it, but it might make more sense to do it in another PR.

@compnerd
Copy link
Member

Okay, a follow up for that would definitely be a good thing.

@compnerd
Copy link
Member

@swift-ci please test

@CodaFi
Copy link
Contributor

CodaFi commented Jun 24, 2020

@CodaFi CodaFi merged commit 2d250bb into swiftlang:master Jun 24, 2020
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.

3 participants