I have get gcc8.2 on aliyun Centos7, but when I get gdb-8.2 and use ./configure make then it occur compile error in ser-tcp.c. Here are error infos:
ser-tcp.c:64:13: error: conflicting declaration ‘typedef int socklen_t’
typedef int socklen_t;
^~~~~~~~~
In file included from build-gnulib/import/unistd.h:40,
from ./gnulib/import/pathmax.h:42,
from ./common/common-defs.h:84,
from defs.h:28,
from ser-tcp.c:20:
/usr/include/unistd.h:274:21: note: previous declaration as ‘typedef __socklen_t socklen_t’
typedef __socklen_t socklen_t;
^~~~~~~~~
ser-tcp.c: In function ‘int net_open(serial*, const char*)’:
ser-tcp.c:223:19: error: ‘FIONBIO’ was not declared in this scope
ioctl (scb->fd, FIONBIO, &ioarg);
^~~~~~~
ser-tcp.c:223:3: error: ‘ioctl’ was not declared in this scope
ioctl (scb->fd, FIONBIO, &ioarg);
^~~~~
As for gcc-compiler, first I install a gcc-4.8.5 by default from yum.Then download gcc-8.2 and compile and replace. Here are my gcc-8.2 -v infos:
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/8.2.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-8.2.0/configure --enable-checking=release --enable- languages=c,c++ --disable-multilib
Thread model: posix
gcc version 8.2.0 (GCC)
By the way, it's not because of not including header, needed header was divided by Macro in the code.The question is why the macro not right in compiling.