Skip to content

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

Closed
MarcelRaad wants to merge 1 commit intocurl:masterfrom
MarcelRaad:sslbackend_wcharsubscripts
Closed

examples/sslbackend: fix -Wchar-subscripts warning#4503
MarcelRaad wants to merge 1 commit intocurl:masterfrom
MarcelRaad:sslbackend_wcharsubscripts

Conversation

@MarcelRaad
Copy link
Member

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
@MarcelRaad MarcelRaad deleted the sslbackend_wcharsubscripts branch October 18, 2019 11:06
@lock lock bot locked as resolved and limited conversation to collaborators Jan 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants