-
Notifications
You must be signed in to change notification settings - Fork 738
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
'strnlen' limits the supported platforms #315
Comments
Fair enough. If you have specific compiler+platform combinations where an alternate implementation is needed, you could submit a PR that makes the necessary change for those platforms. |
It appears to be on all platforms that use cygwin and probably should be a generic replacement. Does adding the following to gsl/string_span sound good?
|
@rianquinn perhaps we should just replace the call to I'd be happy to look at a PR with those changes....;-) |
|
of course! whoops, a "thinko" on my part. In that case, yes, you could add a First, call it something other than Finally, I think rather than doing the pointer arithmetic in your suggested version, couldn't you just use a |
I was thinking that Question: How do you want to determine what platforms support this and which don't? The only test case I have is Also... what do you mean by "qualify a call"... sorry looks like my knowledge of C++ lingo could use some work :) |
Yes, using a I think the easiest thing is to define a "feature" macro for the scope of that file, something like By "qualify the call" I just meant call it with the namespace, to ensure the correct function is used, like so: |
Thanks @vervaekejonathan for the original report and to @rianquinn for fixing this with a PR. |
strnlen (in string_span.h) is not available on all platforms (like arm-none-eabi).
To provide more supported platforms, i suggest to use an own implementation.
The text was updated successfully, but these errors were encountered: