Repository navigation
anyauthput: fix compiler warning on 64-bit Windows - #2972
Closed
MarcelRaad wants to merge 1 commit into
Closed
MarcelRaad wants to merge 1 commit into
MarcelRaad wants to merge 1 commit into
Conversation
bagder
reviewed
Sep 11, 2018
Member
There was a problem hiding this comment.
how about instead writing it in a way that only has the function call in one place?
#ifdef WIN32
#define READ_3RD_ARG unsigned int
#else
#define READ_3RD_ARG size_t
#endif
retcode = read(fd, ptr, (READ_3RD_ARG)(size * nmemb));
Member
Author
There was a problem hiding this comment.
Looks better, yes, and then it can also be integrated into the existing #ifdef. Thanks!
MarcelRaad
force-pushed
the
anyauthput_warning
branch
from
September 11, 2018 20:50
4744b54 to
ae5e989
Compare
On Windows, the read function from <io.h> is used, which has its byte count parameter as unsigned int instead of size_t. Closes curl#2972
MarcelRaad
force-pushed
the
anyauthput_warning
branch
from
September 11, 2018 23:26
ae5e989 to
2a6d671
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows, the read function from
<io.h>is used, which has its bytecount parameter as
unsigned intinstead ofsize_t[0].The warning is visible in the autobuilds: https://curl.haxx.se/dev/log.cgi?id=20180910161513-27869#prob1
[0] https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/read