ITADN

trouble building this

#4OpenXeonG 创建于 2024-08-01
X
XeonGcommented
``` make ─╯ cc -MMD -O2 -flto -s -std=c17 -I. -Wall -pedantic -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wshadow -Wpointer-arith -Wmissing-prototypes -Wcast-qual -Wsign-conversion -Wstrict-overflow=5 -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 -D_GNU_SOURCE -c -o main.o main.c clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument] main.c:154:17: warning: format string is not a string literal [-Wformat-nonliteral] vdprintf(2, format, args); ^~~~~~ main.c:313:61: error: use of undeclared identifier 'SOCK_CLOEXEC' if ((listenfd = socket(p->ai_family, p->ai_socktype|SOCK_CLOEXEC|SOCK_NONBLOCK, p->ai_protocol)) < 0) ^ main.c:313:74: error: use of undeclared identifier 'SOCK_NONBLOCK' if ((listenfd = socket(p->ai_family, p->ai_socktype|SOCK_CLOEXEC|SOCK_NONBLOCK, p->ai_protocol)) < 0) ^ main.c:358:16: error: call to undeclared function 'reallocarray'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] auth_ips = reallocarray(auth_ips, nauth_ips + 1, sizeof(union sockaddr_union)); ^ main.c:358:14: error: incompatible integer to pointer conversion assigning to 'union sockaddr_union *' from 'int' [-Wint-conversion] auth_ips = reallocarray(auth_ips, nauth_ips + 1, sizeof(union sockaddr_union)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:470:39: error: use of undeclared identifier 'MSG_DONTWAIT' n = recv(infd, buf, BUF_SIZE, MSG_DONTWAIT); ^ main.c:760:37: error: use of undeclared identifier 'SOCK_CLOEXEC' fd = socket(family, SOCK_STREAM|SOCK_CLOEXEC, 0); ^ main.c:762:20: warning: implicit conversion changes signedness: 'enum errorcode' to 'int' [-Wsign-conversion] ctx.errc = errno_to_sockscode(); ~ ^~~~~~~~~~~~~~~~~~~~ main.c:770:20: warning: implicit conversion changes signedness: 'enum errorcode' to 'int' [-Wsign-conversion] ctx.errc = errno_to_sockscode(); ~ ^~~~~~~~~~~~~~~~~~~~ main.c:775:20: warning: implicit conversion changes signedness: 'enum errorcode' to 'int' [-Wsign-conversion] ctx.errc = errno_to_sockscode(); ~ ^~~~~~~~~~~~~~~~~~~~ main.c:798:46: warning: implicit conversion changes signedness: 'int' to 'enum errorcode' [-Wsign-conversion] send_error(&t->client, t->client.fd, ctx.errc); ~~~~~~~~~~ ~~~~^~~~ main.c:838:16: error: call to undeclared function 'reallocarray'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] ban_dest = reallocarray(ban_dest, nban_dest + 1, sizeof(struct bandst)); ^ main.c:838:14: error: incompatible integer to pointer conversion assigning to 'struct bandst *' from 'int' [-Wint-conversion] ban_dest = reallocarray(ban_dest, nban_dest + 1, sizeof(struct bandst)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:889:21: error: call to undeclared function 'reallocarray'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] srvrs = reallocarray(srvrs, nsrvrs + 1, sizeof(struct server)); ^ main.c:889:19: error: incompatible integer to pointer conversion assigning to 'struct server *' from 'int' [-Wint-conversion] srvrs = reallocarray(srvrs, nsrvrs + 1, sizeof(struct server)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ main.c:917:17: error: call to undeclared function 'reallocarray'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] srvrs = reallocarray(srvrs, nsrvrs + 1, sizeof(struct server)); ^ main.c:917:15: error: incompatible integer to pointer conversion assigning to 'struct server *' from 'int' [-Wint-conversion] srvrs = reallocarray(srvrs, nsrvrs + 1, sizeof(struct server)); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 5 warnings and 12 errors generated. make: *** [main.o] Error 1 ```
5 条评论