Subject: Re: a libssh2 release soon

Re: a libssh2 release soon

From: Steven Van Ingelgem <steven_at_vaningelgem.be>
Date: Tue, 28 Jul 2009 11:48:09 +0200

2009/7/28 Daniel Stenberg <daniel_at_haxx.se>

> On Tue, 28 Jul 2009, Steven Van Ingelgem wrote:
>
> MinGW compilation with *-Wall -Werror -Wextra*:
>>
>
> -Werror is of course your choice. libssh2 does not build warning free so I
> wouldn't use that...
>

It should build free of warnings ;-)

>
> C:\TEMP\SVN\libssh2\src\session.c: In function 'session_nonblock':
>> C:\TEMP\SVN\libssh2\src\session.c:241: error: unused parameter 'sockfd'
>> C:\TEMP\SVN\libssh2\src\session.c:242: error: unused parameter 'nonblock'
>>
>
> This is more serious that this looks like, as I already posted about. This
> means configure didn't detect a proper way to do non-blocking sockets for
> you and thus the function doesn't do it. And you get the warnings about
> unused variables.
>

I will check why it didn't find a proper way & report back.
==> Ok, found... Bug in my cmake-code ;-).

> C:\TEMP\SVN\libssh2\src\session.c: In function '_libssh2_wait_socket':
>> C:\TEMP\SVN\libssh2\src\session.c:507: error: comparison between signed
>> and
>> unsigned integer expressions
>>
>
> Isn't this again your (local) changing of the socket variable to unsigned?

Nope, after my last mail (and your reply), I noticed I did some changes
(socket_fd to unsigned int instead of int) and reverted them.
This is how MinGW defines "FD_SET":

typedef u_int SOCKET;

#define FD_SETSIZE 64

typedef struct fd_set {
    u_int fd_count;
    SOCKET fd_array[FD_SETSIZE];
} fd_set;

#ifndef FD_SET
/* this differs from the define in winsock.h and in cygwin sys/types.h */
#define FD_SET(fd, set) do { u_int __i;\
for (__i = 0; __i < ((fd_set *)(set))->fd_count ; __i++) {\
* if (((fd_set *)(set))->fd_array[__i] == (fd)) {\*
        break;\
    }\
}\
if (__i == ((fd_set *)(set))->fd_count) {\
    if (((fd_set *)(set))->fd_count < FD_SETSIZE) {\
        ((fd_set *)(set))->fd_array[__i] = (fd);\
        ((fd_set *)(set))->fd_count++;\
    }\
}\
} while(0)
#endif

The "problem" occurs in the line in bold (==(fd)). Because fd_array is of
type uint and fd is of type int, it spawns the warning...

Grtz,
Steven

_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-07-28