Skip to content

lib/v*: silence -Wsign-conversion, tidy-ups, fixes#13472

Closed
vszakats wants to merge 22 commits intocurl:masterfrom
vszakats:signwarn-05
Closed

lib/v*: silence -Wsign-conversion, tidy-ups, fixes#13472
vszakats wants to merge 22 commits intocurl:masterfrom
vszakats:signwarn-05

Conversation

@vszakats
Copy link
Member

@vszakats vszakats commented Apr 25, 2024

lib/v* building without signedness warnings after this PR.

Also:

  • openssl: fix ctx_option_t type for openssl 1.1.x.
  • openssl: add three missing negative checks.
  • sectransp: fix CURLcode/OSStatus mix-up.
  • gtls: add FIXMEs to Curl_gtls_verifyserver().

Cherry-picked from #13489
Follow-up to 3829759 #12489
Closes #13472

vszakats added 21 commits April 29, 2024 18:38
Documentation says it's `long`, but really is `unsigned long`.

```
vtls/openssl.c:3695:38: error: conversion to 'long unsigned int' from 'ctx_option_t' {aka 'long int'} may change the sign of the result [-Werror=sign-conversion]
 3695 |   SSL_CTX_set_options(octx->ssl_ctx, ctx_options);
      |                                      ^~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/8868596554/job/24348345926#step:31:490
temp:
```
C:/projects/curl/lib/vtls/x509asn1.c:961:12: error: cast from function call of type 'CURLcode' to non-matching type 'int' [-Werror=bad-function-cast]
  961 |     return (int)do_pubkey_field(data, certnum, "ecPublicKey", pubkey);
      |            ^
```
Ref: https://ci.appveyor.com/project/curlorg/curl/builds/49704256/job/hcietrd5e7qbu73c#L326
@github-actions github-actions bot added the tests label Apr 29, 2024
@vszakats vszakats changed the title lib: silence -Wsign-conversion in vauth, vtls, openssl lib/v*: silence -Wsign-conversion, tidy-ups Apr 29, 2024
@vszakats vszakats changed the title lib/v*: silence -Wsign-conversion, tidy-ups lib/v*: silence -Wsign-conversion, tidy-ups, fixes Apr 29, 2024
@github-actions github-actions bot added the tests label Apr 29, 2024
@vszakats
Copy link
Member Author

Closing in favour of #13501 and cherry-picking from there. It has the same commits as this one.

@vszakats vszakats closed this May 12, 2024
@vszakats vszakats deleted the signwarn-05 branch May 15, 2024 07:33
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