Subject: Re: Win32 Compilation fixes (MinGW 4.4.0)

Re: Win32 Compilation fixes (MinGW 4.4.0)

From: Daniel Stenberg <>
Date: Mon, 27 Jul 2009 23:15:18 +0200 (CEST)

On Thu, 9 Jul 2009, Steven Van Ingelgem wrote:

> Hereby attached you will find a patch for several warnings fixed:
> - unused parameter 'sockfd'
> - unused parameter 'nonblock'

If they are unused in the session_nonblock() function, there's a bigger
problem since then you won't get your socket non-blocking!

> - comparison between signed and unsigned integer expressions

I don't approve of those changes. Sockets in windows may be unsigned, but they
are then of type SOCKET and thus the reasonable change is to make sure we
detect the correct type and use that all over internally. I suggest we name it
libssh2_socket_t in a manner like:

#ifndef libssh2_socket_typedef
/* socket typedef */
#ifdef WIN32
typedef SOCKET libssh2_socket_t;
typedef int libssh2_socket_t;
#define libssh2_socket_typedef
#endif /* libssh2_socket_typedef */

... and then we should make sure to switch to using that type all over
internally when using sockets (instead of int). But I want to postpone that
until after 1.2.

Received on 2009-07-27