]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: fix `HAVE_IOCTLSOCKET_FIONBIO` test with gcc 14
authorOrgad Shaneh <orgad.shaneh@audiocodes.com>
Fri, 10 May 2024 10:13:32 +0000 (13:13 +0300)
committerViktor Szakats <commit@vsz.me>
Sat, 11 May 2024 08:56:37 +0000 (10:56 +0200)
The function signature has had u_long flags since ever. This is how it
is defined in the documentation, and implemented in MinGW.

The code that uses ioctlsocket in nonblock.c also has unsigned long.

Error:
CurlTests.c:275:41: error: passing argument 3 of 'ioctlsocket' from incompatible pointer type [-Wincompatible-pointer-types]
  275 |         if(0 != ioctlsocket(0, FIONBIO, &flags))
      |                                         ^~~~~~
      |                                         |
      |                                         int *
In file included from CurlTests.c:266:
/opt/mxe/usr/i686-w64-mingw32.static/include/winsock2.h:1007:76: note: expected 'u_long *' {aka 'long unsigned int *'} but argument is of type 'int *'
 1007 |   WINSOCK_API_LINKAGE int WSAAPI ioctlsocket(SOCKET s,__LONG32 cmd,u_long *argp);
      |                                                                    ~~~~~~~~^~~~

Closes #13578

CMake/CurlTests.c

index 83d743d34e41cec77ebdb4be8aafb7f9fb4a6b35..483b9a218b0e3c48fe749ff95e3defa703ce41d7 100644 (file)
@@ -228,7 +228,7 @@ int main(void)
 #endif
 int main(void)
 {
-  int flags = 0;
+  unsigned long flags = 0;
   if(0 != ioctlsocket(0, FIONBIO, &flags))
     return 1;
   ;