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

curl_threads: silence bad-function-cast warning #2908

Closed
wants to merge 1 commit into from

Conversation

MarcelRaad
Copy link
Member

@MarcelRaad 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?

As uintptr_t and HANDLE are always the same size, this warning is
harmless. Just silence it using an intermediate uintptr_t variable.
@MarcelRaad MarcelRaad deleted the winthreads_warning branch August 24, 2018 17:23
falconindy pushed a commit to falconindy/curl that referenced this pull request Sep 10, 2018
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.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants