From c7c344302d81a36b20d3d26a3d13367c8ed2c80d Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 10 Jan 2023 12:31:03 +0100 Subject: [PATCH 1/2] configure.in: C99 compatibility fix Avoid implicit declarations of inet_pton, exit. Include for the glibc declaration. Return from main instead of calling exit. This avoids compilation errors with future compilers. --- configure.in | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index f1cdd10..678fe7d 100644 --- a/configure.in +++ b/configure.in @@ -119,7 +119,7 @@ AC_CHECK_LIB(inet6, main, AC_CHECK_FUNCS(memcpy strtol) AC_CHECK_FUNCS(strcasecmp strncasecmp getopt_long) AC_HEADER_STDC([]) -AC_CHECK_HEADERS(sys/types.h sys/socket.h netinet/in.h netdb.h sys/time.h sys/stat.h sys/fcntl.h malloc.h locale.h stdint.h inttypes.h idna.h) +AC_CHECK_HEADERS(sys/types.h sys/socket.h netinet/in.h netdb.h sys/time.h sys/stat.h sys/fcntl.h malloc.h locale.h stdint.h inttypes.h idna.h arpa/inet.h) AC_HEADER_TIME @@ -139,13 +139,16 @@ AC_TRY_RUN( #ifdef HAVE_NETINET_IN_H #include #endif +#ifdef HAVE_ARPA_INET_H +#include +#endif int main() { struct in6_addr addr6; if (inet_pton(AF_INET6, "::1", &addr6) < 1) - exit(1); + return 1; else - exit(0); + return 0; } ], [ AC_MSG_RESULT(yes) From 96fdd331c21421a313b6b97cb62e0c775ddc061c Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Tue, 10 Jan 2023 12:36:30 +0100 Subject: [PATCH 2/2] : Add timeout_init prototype So that it can be called from the main function. This avoids a compilation error with future compilers. --- include/utils.h | 1 + src/utils.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/utils.h b/include/utils.h index 754ddff..cd98b29 100644 --- a/include/utils.h +++ b/include/utils.h @@ -28,6 +28,7 @@ char *create_string(const char *fmt, ...); int split_host_from_query(struct s_whois_query *wq); int make_connect(const char *, int); int add_text_to_buffer(char **, const char *); +void timeout_init(void); #endif diff --git a/src/utils.c b/src/utils.c index ab01c2c..f82bd1c 100644 --- a/src/utils.c +++ b/src/utils.c @@ -348,7 +348,7 @@ split_host_from_query(struct s_whois_query *wq) * file. */ void -timeout_init() +timeout_init(void) { int iret; char *ret = "75", *ret2;