cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: win32 autobuilds

From: Gisle Vanem <gvanem_at_broadpark.no>
Date: Tue, 9 Mar 2004 23:02:28 +0100

"Daniel Stenberg" <daniel-curl_at_haxx.se> said:

> Does anyone know what the FD_SET() macro does on Windows/MSVC that makes it
> warn on these lines?

The warnings are due to sockets (e.g. extern SOCKET socket ..) is unsigned
on Winsock. On MingW/MSVC it is:

#define FD_SET(fd, set) do { \
    if (((fd_set *)(set))->fd_count < FD_SETSIZE) \
        ((fd_set *)(set))->fd_array[((fd_set *)(set))->fd_count++]=(fd);\
}while (0)

and fd_set:

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

The warning as IMHO harmless. But could be fixed with
FD_SET ((SOCKET)fd, set);

--gv
Received on 2004-03-09