Tinc 1.1_pre15 compilation issue witrh glibc 2.25
Oliver Freyermuth
o.freyermuth at googlemail.com
Wed Apr 4 22:01:52 CEST 2018
Dear Tinc-devs,
trying to compile Tinc 1.1 pre 15 on my Gentoo system, I get the following error:
-----------------------------------------
uml_device.c: In function ‘read_packet’:
uml_device.c:231:25: error: incompatible type for argument 2 of ‘connect’
if(connect(write_fd, (const struct sockkadr *)&request.sock, sizeof request.sock) < 0) {
^
In file included from /usr/include/netinet/in.h:23:0,
from /usr/include/netdb.h:27,
from have.h:109,
from system.h:26,
from uml_device.c:21:
/usr/include/sys/socket.h:131:12: note: expected ‘__CONST_SOCKADDR_ARG {aka union <anonymous>}’ but argument is of type ‘const struct sockkadr *’
extern int connect (int __fd, __CONST_SOCKADDR_ARG __addr, socklen_t __len);
^~~~~~~
-----------------------------------------
/usr/include/sys/socket.h is from glibc 2.25, I am using gcc 6.4.0.
Changing the problematic line as follows:
-----------------------------------------
- if(connect(write_fd, (struct sockkadr *)&request.sock, sizeof request.sock) < 0) {
+ if(connect(write_fd, (const struct sockaddr *)&request.sock, sizeof request.sock) < 0) {
-----------------------------------------
fixes compilation for me.
Cheers,
Oliver
More information about the tinc-devel
mailing list