]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: fix enum/int confusion (Intel C), fix autotools `CFLAGS` for `servers`
authorViktor Szakats <commit@vsz.me>
Thu, 13 Feb 2025 01:38:51 +0000 (02:38 +0100)
committerViktor Szakats <commit@vsz.me>
Thu, 13 Feb 2025 11:46:40 +0000 (12:46 +0100)
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

tests/server/Makefile.am
tests/server/socksd.c
tests/server/sws.c

index c33532fc7cb6d4cc8736cc2be1d2f5c8e3f625f1..a93b2d1bf6aa0cdb7332b442b7cc9c8161474ef0 100644 (file)
@@ -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
index 9052f6944361372e609412ca193d06ea36090afd..27c9c2aa5756c7e904a8482da43bd8d9c9dfeacb 100644 (file)
@@ -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)
 {
index e6aefe3e94d03e4491ab2a3ba3f38b38f5cbaa56..3763410ee075ab74932eb8aff105d65910589101 100644 (file)
 #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;