Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
wants to merge 34 commits into from

Conversation

vszakats
Copy link
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
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