status-im / nim-nat-traversal

Nim NAT traversal using wrappers for miniupnpc and libnatpmp
Apache License 2.0
8 stars 4 forks source link

Compilation warnings on Windows. #7

Open cheatfate opened 2 years ago

cheatfate commented 2 years ago
natpmp.c: In function 'sendpendingrequest':
natpmp.c:125:30: warning: pointer targets in passing argument 2 of 'send' differ in signedness [-Wpointer-sign]
  125 |         r = (int)send(p->s, p->pending_request, p->pending_request_len, 0);
      |                             ~^~~~~~~~~~~~~~~~~
      |                              |
      |                              unsigned char *
In file included from natpmp.c:39:
c:\system\mingw64\x86_64-w64-mingw32\include\winsock2.h:1027:60: note: expected 'const char *' but argument is of type 'unsigned char *'
 1027 |   WINSOCK_API_LINKAGE int WSAAPI send(SOCKET s,const char *buf,int len,int flags);
      |                                                ~~~~~~~~~~~~^~~
natpmp.c: In function 'readnatpmpresponse':
natpmp.c:213:28: warning: pointer targets in passing argument 2 of 'recvfrom' differ in signedness [-Wpointer-sign]
  213 |         n = recvfrom(p->s, buf, sizeof(buf), 0,
      |                            ^~~
      |                            |
      |                            unsigned char *
In file included from natpmp.c:39:
c:\system\mingw64\x86_64-w64-mingw32\include\winsock2.h:1023:58: note: expected 'char *' but argument is of type 'unsigned char *'
 1023 |   WINSOCK_API_LINKAGE int WSAAPI recvfrom(SOCKET s,char *buf,int len,int flags,struct sockaddr *from,int *fromlen);
      |                                                    ~~~~~~^~~
stefantalpalaru commented 2 years ago

Upstream issue. Try https://github.com/miniupnp/libnatpmp for PRs and the forum for bug reports: https://miniupnp.tuxfamily.org/forum/viewforum.php?f=13