-
Notifications
You must be signed in to change notification settings - Fork 351
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
Encoding problem with std::string_view
on macOS
#881
Comments
I can verify this does produce an inconsistent result.
I need to think a bit to see if there is a way to make this work. I agree it is an inconsistency in the API for this not to work, but not entirely sure it should work or we need to make the fail more explicit. stay tuned. |
There are a couple different ways I see to fix this. They all have some drawbacks. The other method would involve executing part of the processing on all options all the time, instead of just as needed. This gets around the race condition but does add extra computation that in most cases is unnecessary. Not entirely sure which method is preferred. |
I have the following minimal example:
If I run the program without any input arguments on Linux (g++), I get the expected output
optionA
.However, if I run it on macOS (clang++), I get the output
����G
, so some encoding problems. If I specify an argument via--input
, the problem is gone. The problem is also gone by replacingstd::string_view
withstd::string
, so this appears to be a bug specific to the usage ofstd::string_view
.The text was updated successfully, but these errors were encountered: