configure: silence compiler warnings in feature checks, drop duplicates

Silence compiler warnings (200 of them across the main CI workflows):
```
warning #2193: null argument provided for parameter marked with attribute "nonnull"
warning: Null pointer passed to 1st parameter expecting 'nonnull' [core.NonNullParamChecker]
warning: Null pointer passed to 2nd parameter expecting 'nonnull' [core.NonNullParamChecker]
warning: argument 1 null where non-null expected [-Wnonnull]
warning: argument 2 null where non-null expected [-Wnonnull]
warning: comparison of unsigned expression in '< 0' is always false [-Wtype-limits]
warning: null argument where non-null required (argument 1) [-Wnonnull]
```

Also drop `if ... can be linked` feature checks that were identical to
`if ... is compilable` checks, for:
`closesocket`, `ioctlsocket`, `socket`, `freeaddrinfo`, `getaddrinfo`,
`gethostname`, `getpeername`, `getsockname`,
`CloseSocket` (AmigaOS), `IoctlSocket` (AmigaOS).
Another option is to really do the link checks. But, if they weren't
missed so far, it seems safer to drop than risk a detection failure,
as was the case with AmigaOS functions while working on this PR.

There remain 22 `-Wnonnull` warnings in `gethostbyname_r()`,
`getpeername()` `getsockname()`. Most of the rest is necessary for
detection, or originate from autotools and CMake detection code
templates. Some still fixable, like duplicate libs.

Follow-up to ca2f49ded0 #16287
Closes #16377
This commit is contained in:
Viktor Szakats 2025-02-18 02:49:31 +01:00
parent 2a292c3984
commit bd9f9b085a
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 99 additions and 297 deletions

View file

@ -689,7 +689,8 @@ AC_DEFUN([CURL_CHECK_FUNC_SEND], [
#endif
#endif
]],[[
send(0, 0, 0, 0);
char s[] = "";
send(0, (void *)s, 0, 0);
]])
],[
AC_MSG_RESULT([yes])