8000 Compilation error with MinGW and GCC 14 · Issue #809 · stephane/libmodbus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Compilation error with MinGW and GCC 14 #809

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
StalderT opened this issue Jun 3, 2025 · 0 comments
Open

Compilation error with MinGW and GCC 14 #809

StalderT opened this issue Jun 3, 2025 · 0 comments

Comments

@StalderT
Copy link
Contributor
StalderT commented Jun 3, 2025

With MinGw and GCC 14 (debian 13 testsing), I have the error :

Making all in src
  CC       modbus.lo
  CC       modbus-data.lo
  CC       modbus-rtu.lo
  CC       modbus-tcp.lo
../../src/modbus-tcp.c: In function '_modbus_tcp_set_ipv4_options':
../../src/modbus-tcp.c:239:50: error: passing argument 4 of 'setsockopt' from incompatible pointer type [-Wincompatible-pointer-types]
  239 |     rc = setsockopt(s, IPPROTO_TCP, TCP_NODELAY, &option, sizeof(int));
      |                                                  ^~~~~~~
      |                                                  |
      |                                                  int *
In file included from ../../src/modbus-tcp.c:31:
/usr/share/mingw-w64/include/winsock2.h:1035:88: note: expected 'const char *' but argument is of type 'int *'
 1035 |   WINSOCK_API_LINKAGE int WSAAPI setsockopt(SOCKET s,int level,int optname,const char *optval,int optlen);
      |                                                                            ~~~~~~~~~~~~^~~~~~
../../src/modbus-tcp.c: In function 'modbus_tcp_listen':
../../src/modbus-tcp.c:566:53: error: passing argument 4 of 'setsockopt' from incompatible pointer type [-Wincompatible-pointer-types]
  566 |     if (setsockopt(new_s, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)) == -1) {
      |                                                     ^~~~~~~
      |                                                     |
      |                                                     int *
/usr/share/mingw-w64/include/winsock2.h:1035:88: note: expected 'const char *' but argument is of type 'int *'
 1035 |   WINSOCK_API_LINKAGE int WSAAPI setsockopt(SOCKET s,int level,int optname,const char *optval,int optlen);
      |                                                                            ~~~~~~~~~~~~^~~~~~
../../src/modbus-tcp.c: In function 'modbus_tcp_pi_listen':
../../src/modbus-tcp.c:683:58: error: passing argument 4 of 'setsockopt' from incompatible pointer type [-Wincompatible-pointer-types]
  683 |             rc = setsockopt(s, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
      |                                                          ^~~~~~~
      |                                                          |
      |                                                          int *
/usr/share/mingw-w64/include/winsock2.h:1035:88: note: expected 'const char *' but argument is of type 'int *'
 1035 |   WINSOCK_API_LINKAGE int WSAAPI setsockopt(SOCKET s,int level,int optname,const char *optval,int optlen);
      |                                                                            ~~~~~~~~~~~~^~~~~~
make[2]: *** [Makefile:486: modbus-tcp.lo] Error 1
make[1]: *** [Makefile:505: all-recursive] Error 1
make: *** [Makefile:391: all] Error 2

This problem appeared with: dde16d5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0