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

curl_threads: silence bad-function-cast warning #2908

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@MarcelRaad
Member

MarcelRaad commented Aug 23, 2018

As uintptr_t and HANDLE are always the same size, this warning is
harmless. Just silence it using an intermediate uintptr_t variable.

This patch silences this warning from the MinGW autobuilds:
https://curl.haxx.se/dev/log.cgi?id=20180823035209-27962#prob3

It will probably break ancient versions of Visual C++ (6 and maybe .NET/2002, if they're not already broken) as they lack uintptr_t and _beginthreadex returns unsigned long for them, if I remember correctly. But I can only guess because we have no testing for them (they won't even install without hacks on modern Windows versions) and my computer refuses to search through 30,000 pages of PDF documentation, which is still downloadable here:
https://docs.microsoft.com/en-us/previous-versions/visualstudio/

Any opinion of how to handle this? Get this in as-is and let possible users of these compilers complain (hopefully there are none) or guess on a fix?

curl_threads: silence bad-function-cast warning
As uintptr_t and HANDLE are always the same size, this warning is
harmless. Just silence it using an intermediate uintptr_t variable.
@bagder

bagder approved these changes Aug 23, 2018

@MarcelRaad MarcelRaad deleted the MarcelRaad:winthreads_warning branch Aug 24, 2018

falconindy added a commit to falconindy/curl that referenced this pull request Sep 10, 2018

curl_threads: silence bad-function-cast warning
As uintptr_t and HANDLE are always the same size, this warning is
harmless. Just silence it using an intermediate uintptr_t variable.

Closes curl#2908

@lock lock bot locked as resolved and limited conversation to collaborators Nov 22, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.