From: Viktor Szakats Date: Thu, 13 Feb 2025 01:38:51 +0000 (+0100) Subject: tests: fix enum/int confusion (Intel C), fix autotools `CFLAGS` for `servers` X-Git-Tag: curl-8_13_0~494 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4aec6cdfd39a1cccd9ea5853e7687247ec219181;p=thirdparty%2Fcurl.git tests: fix enum/int confusion (Intel C), fix autotools `CFLAGS` for `servers` By dropping the unused enum wrappers for `AF_*` macros. Also fix `./configure` to apply `--enable-werror` options to `tests/servers`, to catch this next time. Seen with Intel C compiler: ``` socksd.c(184): warning #188: enumerated type mixed with another type socksd.c(881): warning #188: enumerated type mixed with another type [...] sws.c(76): warning #188: enumerated type mixed with another type sws.c(229): warning #188: enumerated type mixed with another type [...] ``` Ref: https://github.com/curl/curl/actions/runs/13296520425/job/37129676921#step:40:338 Closes #16314 --- diff --git a/tests/server/Makefile.am b/tests/server/Makefile.am index c33532fc7c..a93b2d1bf6 100644 --- a/tests/server/Makefile.am +++ b/tests/server/Makefile.am @@ -40,6 +40,8 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) +CFLAGS += @CURL_CFLAG_EXTRAS@ + if DOING_NATIVE_WINDOWS AM_CPPFLAGS += -DCURL_STATICLIB endif diff --git a/tests/server/socksd.c b/tests/server/socksd.c index 9052f69443..27c9c2aa57 100644 --- a/tests/server/socksd.c +++ b/tests/server/socksd.c @@ -173,15 +173,7 @@ static unsigned short shortval(char *value) return num & 0xffff; } -static enum { - socket_domain_inet = AF_INET -#ifdef USE_IPV6 - , socket_domain_inet6 = AF_INET6 -#endif -#ifdef USE_UNIX_SOCKETS - , socket_domain_unix = AF_UNIX -#endif -} socket_domain = AF_INET; +static int socket_domain = AF_INET; static void getconfig(void) { diff --git a/tests/server/sws.c b/tests/server/sws.c index e6aefe3e94..3763410ee0 100644 --- a/tests/server/sws.c +++ b/tests/server/sws.c @@ -65,15 +65,7 @@ #define ERANGE 34 /* errno.h value */ #endif -static enum { - socket_domain_inet = AF_INET -#ifdef USE_IPV6 - , socket_domain_inet6 = AF_INET6 -#endif -#ifdef USE_UNIX_SOCKETS - , socket_domain_unix = AF_UNIX -#endif -} socket_domain = AF_INET; +static int socket_domain = AF_INET; static bool use_gopher = FALSE; static int serverlogslocked = 0; static bool is_proxy = FALSE;