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

examples/sslbackend: fix -Wchar-subscripts warning #4503

Closed

Conversation

@MarcelRaad
Copy link
Member

MarcelRaad commented Oct 18, 2019

With the isdigit implementation that comes with MSYS2, the argument
is used as an array subscript, resulting in a -Wchar-subscripts
warning. isdigit's behavior is undefined if the argument is negative
and not EOF [0]. As done in lib/curl_ctype.h, cast the char variable
to unsigned char to avoid that.

[0] https://en.cppreference.com/w/c/string/byte/isdigit

With the `isdigit` implementation that comes with MSYS2, the argument
is used as an array subscript, resulting in a -Wchar-subscripts
warning. `isdigit`'s behavior is undefined if the argument is negative
and not EOF [0]. As done in lib/curl_ctype.h, cast the `char` variable
to `unsigned char` to avoid that.

[0] https://en.cppreference.com/w/c/string/byte/isdigit

Closes
@bagder
bagder approved these changes Oct 18, 2019
@MarcelRaad MarcelRaad deleted the MarcelRaad:sslbackend_wcharsubscripts branch Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.