Skip to content

configure: silence compiler warnings in feature checks, drop duplicates#16377

Closed
vszakats wants to merge 34 commits intocurl:masterfrom
vszakats:det-warn-3
Closed

configure: silence compiler warnings in feature checks, drop duplicates#16377
vszakats wants to merge 34 commits intocurl:masterfrom
vszakats:det-warn-3

Conversation

@vszakats
Copy link
Copy Markdown
Member

@vszakats vszakats commented Feb 18, 2025

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 ca2f49d #16287


w/o ws https://github.com/curl/curl/pull/16377/files?w=1

This may be of interest, also in tests/server/util.c where the deprecated siginterrupt serves as a fallback
since 3fb6e5a:

warning #1786: function "siginterrupt" (declared at line 324 of "/usr/include/signal.h") was declared deprecated ("Use sigaction with SA_RESTART instead")
warning: 'siginterrupt' is deprecated: Use sigaction with SA_RESTART instead [-Wdeprecated-declarations]

@vszakats vszakats marked this pull request as draft February 18, 2025 02:19
@github-actions github-actions bot added tests CI Continuous Integration labels Feb 18, 2025
@vszakats vszakats changed the title build: fix compiler warnings in feature detections (cont.) configure: fix compiler warnings in feature detections (cont.) Feb 19, 2025
@vszakats vszakats marked this pull request as ready for review February 19, 2025 00:43
@vszakats vszakats changed the title configure: fix compiler warnings in feature detections (cont.) configure: fix compiler warnings in feature detections, drop duplicate checks Feb 19, 2025
@vszakats vszakats removed tests CI Continuous Integration labels Feb 19, 2025
@vszakats vszakats changed the title configure: fix compiler warnings in feature detections, drop duplicate checks configure: silence compiler warnings in feature checks, drop duplicates Feb 19, 2025
@vszakats vszakats closed this in bd9f9b0 Feb 21, 2025
@vszakats vszakats deleted the det-warn-3 branch February 21, 2025 13:06
vszakats added a commit to vszakats/curl that referenced this pull request Feb 21, 2025
Seen in Android 21/35 CI jobs:
```
/home/runner/work/curl/curl/CMake/CurlTests.c:315:16: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
   315 |   fsetxattr(0, 0, 0, 0, 0);
       |                ^
 1 warning generated.
```
Ref: https://github.com/curl/curl/actions/runs/13460225795/job/37613494183#step:9:5978

Follow-up to bd9f9b0 curl#16377
vszakats added a commit that referenced this pull request Feb 21, 2025
Seen in Android 21/35 CI jobs:
```
curl/CMake/CurlTests.c:315:16: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
   315 |   fsetxattr(0, 0, 0, 0, 0);
       |                ^
 1 warning generated.
```
Ref: https://github.com/curl/curl/actions/runs/13460225795/job/37613494183#step:9:5978

Follow-up to bd9f9b0 #16377
Closes #16427
vszakats added a commit to vszakats/curl that referenced this pull request Apr 2, 2025
Partial revert of, regression from bd9f9b0 curl#16377
Reported-by: Dagobert Michelsen
Fixes: curl#16915

---

FIXME: This will likely break CloseSocket detection for AmigaOS
@vszakats vszakats mentioned this pull request Apr 2, 2025
1 task
vszakats added a commit that referenced this pull request Apr 2, 2025
The omitted link checks were not what I though they were. Omitting one
caused a mis-detection on Solaris, where the compile check alone
mis-detects `CloseSocket` as present.

Restore link checks for these functions:
`closesocket`, `ioctlsocket`, `socket`, `freeaddrinfo`, `getaddrinfo`,
`gethostname`, `getpeername`, `getsockname`,
`CloseSocket` (AmigaOS), `IoctlSocket` (AmigaOS).

Also re-sync link check code snippets with the ones in current master.

Partial revert of, regression from bd9f9b0 #16377
Reported-by: Dagobert Michelsen
Bug: https://curl.se/mail/lib-2025-04/0004.html
Fixes #16915
Closes #16917
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Silence compiler warnings (200 of them across the main CI workflows):
```
warning curl#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 ca2f49d curl#16287
Closes curl#16377
pps83 pushed a commit to pps83/curl that referenced this pull request Apr 26, 2025
Seen in Android 21/35 CI jobs:
```
curl/CMake/CurlTests.c:315:16: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
   315 |   fsetxattr(0, 0, 0, 0, 0);
       |                ^
 1 warning generated.
```
Ref: https://github.com/curl/curl/actions/runs/13460225795/job/37613494183#step:9:5978

Follow-up to bd9f9b0 curl#16377
Closes curl#16427
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

1 participant