I'm researching what to do to decrease the number of compiler warnings in our regular CI builds. I took a closer look at our AppVeyor builds for windows. They generate MSVC project files with cmake and build curl.
Our use of the sread() and swrite() macros in the code should not cause compiler warnings, but they do.
Since send() and recv() on various systems are not always following the POSIX prototype, we try to detect what arguments they prefer. This is done by autotools and by cmake, for all platforms. The cmake code that checks these functions for MSVC on windows seem to pick the first tested argument set, which is the POSIX complient set, which is not the set that Windows' recv() and send() functions want. This then makes the compiler generate a lot of warnings about conversions from size_t to int (the third argument).
On Windows, the prototypes for these functions look like this:
int recv(SOCKET s, char *buf, int len, int flags);
int send(SOCKET s, const char *buf, int len, int flags);
The text was updated successfully, but these errors were encountered: