Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
gtls: fix build when sizeof(long) < sizeof(void *) #1617
unfortunately we don't have intptr_t in c89. we could use ptrdiff_t which is not technically correct since it's only meant to hold the difference between two members of the same array. it seems like casting between (gnutls_transport_ptr) would make more sense but it looks like those macros were added to fix the warning that comes from doing that.
I took this idea a little further: if we pretend that we have a hypothetical character array starting at
The patch was updated accordingly.
I verified that this fixes the compiler warning on Windows.
added a commit
this pull request
Jun 30, 2017
No. It seems like it's UB either way. To touch on what you said about 32 bits I think it could be improved if we rename them socket macros and cast to curl_socket_t since that's the type. Barring input from @gknauf how about these modifications to @dscho's work https://github.com/curl/curl/compare/master...jay:pr_1617_amended?expand=1 . I'm not sure if it would resurrect the warnings though
@jay sadly, this does not work: